gcc/gcc/config/ia64/ia64.c

10866 lines
311 KiB
C
Raw Normal View History

2000-03-09 01:26:04 +01:00
/* Definitions of target machine for GNU compiler.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.c (hook_bool_const_int_const_int_true): New function. * target.h (struct gcc_target): Add can_eliminate field. * target-def.h (TARGET_CAN_ELIMINATE): Define. (TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE. * ira.c (setup_eliminable_regset): Use can_eliminate target hook. * reload1.c (update_eliminables, init_elim_table): (Ditto.). (elim_table): Revise comment. * system.h (CAN_ELIMINATE): Poison. * defaults.h (CAN_ELIMINATE): Remove. * doc/tm.texi (CAN_ELIMINATE): Revise documentation. * config/alpha/vms.h (CAN_ELIMINATE): Remove macro. * config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]: Define macro. (alpha_vms_can_eliminate): Declare as static, change return type to bool. * config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove. * config/arm/arm.h (CAN_ELIMINATE): Remove macro. * config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro. (arm_can_eliminate): New function. * config/avr/avr.h (CAN_ELIMINATE): Remove macro. * config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro. (avr_can_eliminate): Declare as static. * config/avr/avr-protos.h (avr_can_eliminate): Remove. * config/bfin/bfin.h (CAN_ELIMINATE): Remove macro. * config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro. (bfin_can_eliminate): New function. * config/crx/crx.h (CAN_ELIMINATE): Remove macro. * config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro. (crx_can_eliminate): New function. * config/fr30/fr30.h (CAN_ELIMINATE): Remove macro. * config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro. (fr30_can_eliminate): New function. * config/frv/frv.h (CAN_ELIMINATE): Remove macro. * config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro. (frv_can_eliminate): New function. * config/h8300/h8300.h (CAN_ELIMINATE): Remove macro. * config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro. (h8300_can_eliminate): New function. * config/i386/i386.h (CAN_ELIMINATE): Remove macro. * config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro. (i386_can_eliminate): Declare as static, change return type to bool. * config/i386/i386-protos.h (i386_can_eliminate): Remove. * config/ia64/ia64.h (CAN_ELIMINATE): Remove macro. * config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro. (ia64_can_eliminate): New function. * config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro. * config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro. (iq2000_can_eliminate): New function. * config/m32r/m32r.h (CAN_ELIMINATE): Remove macro. * config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro. (m32r_can_eliminate): New function. * config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro. * config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro. (m68hc11_can_eliminate): New function. * config/m68k/m68k.h (CAN_ELIMINATE): Remove macro. * config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro. (m68k_can_eliminate): New function. * config/mep/mep.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro. (mep_can_eliminate): New function. * config/mips/mips.h (CAN_ELIMINATE): Remove macro. * config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro. (mips_can_eliminate): New function. * config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro. * config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro. (rs6000_can_eliminate): New function. * config/s390/s390.h (CAN_ELIMINATE): Remove macro. * config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro. (s390_can_eliminate): Declare as static. * config/s390/s390-protos.h (sparc_can_eliminate): Remove. * config/score/score.h (CAN_ELIMINATE): Remove macro. * config/score/score.c (TARGET_CAN_ELIMINATE): Define macro. (score_can_eliminate): New function. * config/sparc/sparc.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro. (sparc_can_eliminate): Declare as static. * config/sparc/sparc-protos.h (sparc_can_eliminate): Remove. * config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro. * config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro. (xstormy16_can_eliminate): New function. * config/v850/v850.h (CAN_ELIMINATE): Remove macro. * config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro. (v850_can_eliminate): New function. From-SVN: r151096
2009-08-25 23:09:00 +02:00
2009
Free Software Foundation, Inc.
2000-03-09 01:26:04 +01:00
Contributed by James E. Wilson <wilson@cygnus.com> and
David Mosberger <davidm@hpl.hp.com>.
2000-03-09 01:26:04 +01:00
This file is part of GCC.
2000-03-09 01:26:04 +01:00
GCC is free software; you can redistribute it and/or modify
2000-03-09 01:26:04 +01:00
it under the terms of the GNU General Public License as published by
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License... * config/host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * config/alpha/predicates.md, config/alpha/vms-ld.c, config/alpha/linux.h, config/alpha/alpha.opt, config/alpha/linux-elf.h, config/alpha/vms.h, config/alpha/elf.h, config/alpha/vms-unwind.h, config/alpha/ev4.md, config/alpha/ev6.md, config/alpha/alpha.c, config/alpha/vms-cc.c, config/alpha/alpha.h, config/alpha/sync.md, config/alpha/openbsd.h, config/alpha/alpha.md, config/alpha/alpha-modes.def, config/alpha/ev5.md, config/alpha/alpha-protos.h, config/alpha/freebsd.h, config/alpha/osf5.h, config/alpha/netbsd.h, config/alpha/vms64.h, config/alpha/constraints.md, config/alpha/osf.h, config/alpha/xm-vms.h, config/alpha/unicosmk.h, config/linux.h, config/frv/predicates.md, config/frv/frv.h, config/frv/linux.h, config/frv/frv.md, config/frv/frv.opt, config/frv/frv-modes.def, config/frv/frv-asm.h, config/frv/frv-protos.h, config/frv/frv-abi.h, config/frv/frv.c, config/s390/tpf.h, config/s390/s390.c, config/s390/predicates.md, config/s390/s390.h, config/s390/linux.h, config/s390/tpf.md, config/s390/tpf.opt, config/s390/2064.md, config/s390/2084.md, config/s390/s390.md, config/s390/s390.opt, config/s390/s390-modes.def, config/s390/fixdfdi.h, config/s390/constraints.md, config/s390/s390-protos.h, config/s390/s390x.h, config/elfos.h, config/dbxcoff.h, config/m32c/predicates.md, config/m32c/cond.md, config/m32c/m32c.c, config/m32c/minmax.md, config/m32c/blkmov.md, config/m32c/m32c-pragma.c, config/m32c/m32c.h, config/m32c/prologue.md, config/m32c/m32c.abi, config/m32c/muldiv.md, config/m32c/bitops.md, config/m32c/mov.md, config/m32c/addsub.md, config/m32c/m32c.md, config/m32c/m32c.opt, config/m32c/t-m32c, config/m32c/m32c-modes.def, config/m32c/jump.md, config/m32c/shift.md, config/m32c/m32c-protos.h, config/libgloss.h, config/spu/spu-protos.h, config/spu/predicates.md, config/spu/spu-builtins.h, config/spu/spu.c, config/spu/spu-builtins.def, config/spu/spu-builtins.md, config/spu/spu.h, config/spu/spu-elf.h, config/spu/constraints.md, config/spu/spu.md, config/spu/spu-c.c, config/spu/spu.opt, config/spu/spu-modes.def, config/spu/t-spu-elf, config/interix.h, config/sparc/hypersparc.md, config/sparc/predicates.md, config/sparc/linux.h, config/sparc/sp64-elf.h, config/sparc/supersparc.md, config/sparc/cypress.md, config/sparc/openbsd1-64.h, config/sparc/openbsd64.h, config/sparc/niagara.md, config/sparc/sparc.md, config/sparc/long-double-switch.opt, config/sparc/ultra3.md, config/sparc/sparc.opt, config/sparc/sync.md, config/sparc/sp-elf.h, config/sparc/sparc-protos.h, config/sparc/ultra1_2.md, config/sparc/biarch64.h, config/sparc/sparc.c, config/sparc/little-endian.opt, config/sparc/sysv4-only.h, config/sparc/sparc.h, config/sparc/linux64.h, config/sparc/freebsd.h, config/sparc/sol2.h, config/sparc/rtemself.h, config/sparc/netbsd-elf.h, config/sparc/vxworks.h, config/sparc/sparc-modes.def, config/sparc/sparclet.md, config/sparc/sysv4.h, config/vx-common.h, config/netbsd-aout.h, config/flat.h, config/m32r/m32r.md, config/m32r/predicates.md, config/m32r/little.h, config/m32r/m32r.c, config/m32r/m32r.opt, config/m32r/linux.h, config/m32r/constraints.md, config/m32r/m32r.h, config/m32r/m32r-protos.h, config/vxworks.opt, config/darwin-c.c, config/darwin.opt, config/i386/i386.h, config/i386/cygming.h, config/i386/linux.h, config/i386/cygwin.h, config/i386/i386.md, config/i386/netware-crt0.c, config/i386/sco5.h, config/i386/mmx.md, config/i386/vx-common.h, config/i386/kaos-i386.h, config/i386/winnt-stubs.c, config/i386/netbsd64.h, config/i386/djgpp.h, config/i386/gas.h, config/i386/sol2.h, config/i386/constraints.md, config/i386/netware-libgcc.c, config/i386/sysv5.h, config/i386/predicates.md, config/i386/geode.md, config/i386/x86-64.h, config/i386/kfreebsd-gnu.h, config/i386/freebsd64.h, config/i386/vxworksae.h, config/i386/pentium.md, config/i386/lynx.h, config/i386/i386elf.h, config/i386/rtemself.h, config/i386/netbsd-elf.h, config/i386/ppro.md, config/i386/k6.md, config/i386/netware.c, config/i386/netware.h, config/i386/i386-modes.def, config/i386/sysv4-cpp.h, config/i386/i386-interix.h, config/i386/cygwin1.c, config/i386/djgpp.opt, config/i386/uwin.h, config/i386/unix.h, config/i386/ptx4-i.h, config/i386/xm-djgpp.h, config/i386/att.h, config/i386/winnt.c, config/i386/beos-elf.h, config/i386/sol2-10.h, config/i386/darwin64.h, config/i386/sse.md, config/i386/i386.opt, config/i386/bsd.h, config/i386/cygming.opt, config/i386/xm-mingw32.h, config/i386/linux64.h, config/i386/openbsdelf.h, config/i386/xm-cygwin.h, config/i386/sco5.opt, config/i386/darwin.h, config/i386/mingw32.h, config/i386/winnt-cxx.c, config/i386/i386-interix3.h, config/i386/nwld.c, config/i386/nwld.h, config/i386/host-cygwin.c, config/i386/cygwin2.c, config/i386/i386-protos.h, config/i386/sync.md, config/i386/openbsd.h, config/i386/host-mingw32.c, config/i386/i386-aout.h, config/i386/nto.h, config/i386/biarch64.h, config/i386/i386-coff.h, config/i386/freebsd.h, config/i386/driver-i386.c, config/i386/knetbsd-gnu.h, config/i386/host-i386-darwin.c, config/i386/vxworks.h, config/i386/crtdll.h, config/i386/i386.c, config/i386/sysv4.h, config/darwin-protos.h, config/linux.opt, config/sol2.c, config/sol2.h, config/sh/symbian.c, config/sh/sh-protos.h, config/sh/linux.h, config/sh/elf.h, config/sh/superh.h, config/sh/sh4.md, config/sh/coff.h, config/sh/newlib.h, config/sh/embed-elf.h, config/sh/symbian-pre.h, config/sh/rtems.h, config/sh/kaos-sh.h, config/sh/sh4a.md, config/sh/constraints.md, config/sh/sh64.h, config/sh/sh.opt, config/sh/symbian-post.h, config/sh/sh-c.c, config/sh/predicates.md, config/sh/sh.c, config/sh/sh.h, config/sh/shmedia.md, config/sh/sh-modes.def, config/sh/little.h, config/sh/sh1.md, config/sh/sh4-300.md, config/sh/superh64.h, config/sh/rtemself.h, config/sh/netbsd-elf.h, config/sh/sh.md, config/sh/vxworks.h, config/usegas.h, config/svr3.h, config/pdp11/pdp11-protos.h, config/pdp11/2bsd.h, config/pdp11/pdp11.md, config/pdp11/pdp11.c, config/pdp11/pdp11.opt, config/pdp11/pdp11-modes.def, config/pdp11/pdp11.h, config/avr/rtems.h, config/avr/avr-protos.h, config/avr/predicates.md, config/avr/constraints.md, config/avr/avr.md, config/avr/avr.c, config/avr/avr.opt, config/avr/avr.h, config/sol2-protos.h, config/dbxelf.h, config/lynx.opt, config/crx/crx.h, config/crx/crx-protos.h, config/crx/crx.md, config/crx/crx.c, config/crx/crx.opt, config/c4x/c4x-c.c, config/c4x/c4x.c, config/c4x/c4x.opt, config/c4x/c4x-modes.def, config/c4x/rtems.h, config/c4x/predicates.md, config/c4x/c4x.h, config/c4x/c4x-protos.h, config/c4x/c4x.md, config/kfreebsd-gnu.h, config/xtensa/predicates.md, config/xtensa/xtensa.c, config/xtensa/linux.h, config/xtensa/xtensa.h, config/xtensa/elf.h, config/xtensa/xtensa.md, config/xtensa/xtensa.opt, config/xtensa/constraints.md, config/xtensa/xtensa-protos.h, config/dbx.h, config/stormy16/predicates.md, config/stormy16/stormy16.md, config/stormy16/stormy16.c, config/stormy16/stormy16.opt, config/stormy16/stormy16.h, config/stormy16/stormy16-protos.h, config/host-solaris.c, config/fr30/fr30.h, config/fr30/predicates.md, config/fr30/fr30-protos.h, config/fr30/fr30.md, config/fr30/fr30.c, config/fr30/fr30.opt, config/vxworksae.h, config/sol2-c.c, config/lynx.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/predicates.md, config/m68hc11/m68hc11.md, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.opt, config/m68hc11/m68hc11.h, config/m68hc11/m68hc12.h, config/openbsd-oldgas.h, config/host-linux.c, config/interix3.h, config/cris/cris.c, config/cris/predicates.md, config/cris/linux.h, config/cris/cris.h, config/cris/aout.h, config/cris/cris.md, config/cris/linux.opt, config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt, config/cris/cris-protos.h, config/vxworks-dummy.h, config/netbsd.h, config/netbsd-elf.h, config/iq2000/iq2000.h, config/iq2000/predicates.md, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.md, config/iq2000/iq2000.c, config/iq2000/iq2000.opt, config/host-darwin.c, config/mt/mt.md, config/mt/mt.c, config/mt/mt.opt, config/mt/t-mt, config/mt/mt.h, config/mt/mt-protos.h, config/svr4.h, config/host-darwin.h, config/chorus.h, config/mn10300/mn10300.c, config/mn10300/mn10300.opt, config/mn10300/predicates.md, config/mn10300/mn10300.h, config/mn10300/linux.h, config/mn10300/constraints.md, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.md, config/ia64/predicates.md, config/ia64/itanium1.md, config/ia64/unwind-ia64.h, config/ia64/ia64-c.c, config/ia64/sync.md, config/ia64/ia64.c, config/ia64/itanium2.md, config/ia64/ia64.h, config/ia64/vect.md, config/ia64/freebsd.h, config/ia64/ia64.md, config/ia64/ia64-modes.def, config/ia64/constraints.md, config/ia64/hpux.h, config/ia64/ia64-protos.h, config/windiss.h, config/gofast.h, config/rtems.h, config/sol2-10.h, config/m68k/predicates.md, config/m68k/m68k.md, config/m68k/linux.h, config/m68k/m68k-modes.def, config/m68k/print-sysroot-suffix.sh, config/m68k/m68k-protos.h, config/m68k/coff.h, config/m68k/m68k-none.h, config/m68k/ieee.opt, config/m68k/openbsd.h, config/m68k/m68k-aout.h, config/m68k/m68k.opt, config/m68k/m68020-elf.h, config/m68k/m68kelf.h, config/m68k/m68k-devices.def, config/m68k/uclinux-oldabi.h, config/m68k/m68k.c, config/m68k/constraints.md, config/m68k/rtemself.h, config/m68k/netbsd-elf.h, config/m68k/m68k.h, config/m68k/uclinux.h, config/rs6000/power4.md, config/rs6000/host-darwin.c, config/rs6000/6xx.md, config/rs6000/linux.h, config/rs6000/eabi.h, config/rs6000/aix41.opt, config/rs6000/xcoff.h, config/rs6000/secureplt.h, config/rs6000/linuxspe.h, config/rs6000/eabialtivec.h, config/rs6000/8540.md, config/rs6000/darwin8.h, config/rs6000/kaos-ppc.h, config/rs6000/windiss.h, config/rs6000/603.md, config/rs6000/aix41.h, config/rs6000/cell.md, config/rs6000/mpc.md, config/rs6000/aix43.h, config/rs6000/beos.h, config/rs6000/gnu.h, config/rs6000/rtems.h, config/rs6000/aix.opt, config/rs6000/darwin.md, config/rs6000/darwin64.h, config/rs6000/default64.h, config/rs6000/7xx.md, config/rs6000/darwin.opt, config/rs6000/spe.md, config/rs6000/rs6000.opt, config/rs6000/rs6000-c.c, config/rs6000/rios2.md, config/rs6000/linuxaltivec.h, config/rs6000/7450.md, config/rs6000/linux64.h, config/rs6000/constraints.md, config/rs6000/440.md, config/rs6000/darwin.h, config/rs6000/host-ppc64-darwin.c, config/rs6000/rs6000.c, config/rs6000/aix52.h, config/rs6000/rs6000.h, config/rs6000/power6.md, config/rs6000/predicates.md, config/rs6000/altivec.md, config/rs6000/aix64.opt, config/rs6000/rios1.md, config/rs6000/rs6000-modes.def, config/rs6000/rs64.md, config/rs6000/eabisim.h, config/rs6000/sysv4le.h, config/rs6000/darwin7.h, config/rs6000/dfp.md, config/rs6000/linux64.opt, config/rs6000/sync.md, config/rs6000/vxworksae.h, config/rs6000/power5.md, config/rs6000/lynx.h, config/rs6000/biarch64.h, config/rs6000/rs6000.md, config/rs6000/sysv4.opt, config/rs6000/eabispe.h, config/rs6000/e500.h, config/rs6000/freebsd.h, config/rs6000/rs6000-protos.h, config/rs6000/netbsd.h, config/rs6000/e500-double.h, config/rs6000/aix.h, config/rs6000/vxworks.h, config/rs6000/40x.md, config/rs6000/aix51.h, config/rs6000/sysv4.h, config/arc/arc-protos.h, config/arc/arc.md, config/arc/arc.c, config/arc/arc.opt, config/arc/arc-modes.def, config/arc/arc.h, config/mcore/mcore-elf.h, config/mcore/mcore-protos.h, config/mcore/predicates.md, config/mcore/mcore.md, config/mcore/mcore.c, config/mcore/mcore.opt, config/mcore/mcore.h, config/mcore/mcore-pe.h, config/darwin.c, config/freebsd-nthr.h, config/score/predicates.md, config/score/score-version.h, config/score/score-protos.h, config/score/misc.md, config/score/elf.h, config/score/score.c, config/score/mac.md, config/score/score7.md, config/score/score.h, config/score/score-conv.h, config/score/score-mdaux.c, config/score/score.md, config/score/score.opt, config/score/score-modes.def, config/score/score-mdaux.h, config/score/mul-div.S, config/arm/uclinux-elf.h, config/arm/semi.h, config/arm/ecos-elf.h, config/arm/arm1020e.md, config/arm/symbian.h, config/arm/linux-elf.h, config/arm/arm1026ejs.md, config/arm/arm1136jfs.md, config/arm/elf.h, config/arm/aout.h, config/arm/arm.c, config/arm/thumb2.md, config/arm/vec-common.md, config/arm/coff.h, config/arm/strongarm-pe.h, config/arm/arm.h, config/arm/cortex-a8-neon.md, config/arm/semiaof.h, config/arm/cortex-a8.md, config/arm/uclinux-eabi.h, config/arm/arm-modes.def, config/arm/linux-eabi.h, config/arm/rtems-elf.h, config/arm/neon-schedgen.ml, config/arm/arm-cores.def, config/arm/arm-protos.h, config/arm/vfp.md, config/arm/aof.h, config/arm/linux-gas.h, config/arm/wince-pe.h, config/arm/neon.md, config/arm/constraints.md, config/arm/neon.ml, config/arm/xscale-elf.h, config/arm/strongarm-coff.h, config/arm/arm.opt, config/arm/arm926ejs.md, config/arm/predicates.md, config/arm/iwmmxt.md, config/arm/arm_neon.h, config/arm/unknown-elf.h, config/arm/kaos-arm.h, config/arm/bpabi.h, config/arm/pe.opt, config/arm/neon-testgen.ml, config/arm/arm.md, config/arm/xscale-coff.h, config/arm/pe.c, config/arm/arm-generic.md, config/arm/pe.h, config/arm/kaos-strongarm.h, config/arm/freebsd.h, config/arm/neon-docgen.ml, config/arm/netbsd.h, config/arm/fpa.md, config/arm/strongarm-elf.h, config/arm/cirrus.md, config/arm/netbsd-elf.h, config/arm/vxworks.h, config/arm/neon-gen.ml, config/kaos.h, config/darwin-driver.c, config/pa/predicates.md, config/pa/pa64-hpux.h, config/pa/pa-hpux.opt, config/pa/som.h, config/pa/pa-hpux1010.opt, config/pa/pa-hpux1111.opt, config/pa/pa-pro-end.h, config/pa/elf.h, config/pa/fptr.c, config/pa/pa64-linux.h, config/pa/pa.md, config/pa/pa.opt, config/pa/pa-hpux.h, config/pa/pa-hpux10.h, config/pa/pa-hpux11.h, config/pa/pa-hpux1010.h, config/pa/pa-protos.h, config/pa/pa-osf.h, config/pa/pa-hpux1111.h, config/pa/pa-64.h, config/pa/milli64.S, config/pa/pa.c, config/pa/pa-linux.h, config/pa/pa.h, config/pa/pa32-linux.h, config/pa/pa64-hpux.opt, config/pa/pa64-regs.h, config/pa/pa-modes.def, config/pa/constraints.md, config/darwin9.h, config/mips/4100.md, config/mips/linux.h, config/mips/elfoabi.h, config/mips/elf.h, config/mips/sdb.h, config/mips/windiss.h, config/mips/rtems.h, config/mips/3000.md, config/mips/iris5.h, config/mips/5000.md, config/mips/7000.md, config/mips/9000.md, config/mips/4600.md, config/mips/linux64.h, config/mips/elforion.h, config/mips/constraints.md, config/mips/generic.md, config/mips/predicates.md, config/mips/4300.md, config/mips/mips-ps-3d.md, config/mips/iris.h, config/mips/24k.md, config/mips/mips.md, config/mips/mips.opt, config/mips/4k.md, config/mips/5k.md, config/mips/vr4120-div.S, config/mips/openbsd.h, config/mips/iris6.h, config/mips/4000.md, config/mips/mips-protos.h, config/mips/6000.md, config/mips/mips.c, config/mips/mips.h, config/mips/r3900.h, config/mips/74k.md, config/mips/netbsd.h, config/mips/vxworks.h, config/mips/mips-modes.def, config/mips/vr.h, config/soft-fp/t-softfp, config/openbsd.h, config/ptx4.h, config/freebsd-spec.h, config/vax/vax.c, config/vax/openbsd.h, config/vax/vax.h, config/vax/elf.h, config/vax/vax.md, config/vax/bsd.h, config/vax/vax.opt, config/vax/vax-modes.def, config/vax/openbsd1.h, config/vax/netbsd.h, config/vax/vax-protos.h, config/vax/netbsd-elf.h, config/vax/vaxv.h, config/vax/ultrix.h, config/freebsd.h, config/h8300/rtems.h, config/h8300/predicates.md, config/h8300/h8300.c, config/h8300/h8300.h, config/h8300/elf.h, config/h8300/h8300.md, config/h8300/h8300.opt, config/h8300/coff.h, config/h8300/h8300-protos.h, config/v850/v850.md, config/v850/predicates.md, config/v850/v850-c.c, config/v850/v850.c, config/v850/v850.opt, config/v850/v850.h, config/v850/v850-protos.h, config/vxworks.c, config/knetbsd-gnu.h, config/sol2-6.h, config/vxworks.h, config/mmix/mmix.h, config/mmix/predicates.md, config/mmix/mmix-protos.h, config/mmix/mmix.md, config/mmix/mmix.c, config/mmix/mmix.opt, config/mmix/mmix-modes.def, config/bfin/bfin.opt, config/bfin/rtems.h, config/bfin/bfin-modes.def, config/bfin/predicates.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/bfin/bfin.h, config/bfin/bfin.md: Likewise. From-SVN: r127157
2007-08-02 12:49:31 +02:00
the Free Software Foundation; either version 3, or (at your option)
2000-03-09 01:26:04 +01:00
any later version.
GCC is distributed in the hope that it will be useful,
2000-03-09 01:26:04 +01:00
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.
You should have received a copy of the GNU General Public License
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License... * config/host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * config/alpha/predicates.md, config/alpha/vms-ld.c, config/alpha/linux.h, config/alpha/alpha.opt, config/alpha/linux-elf.h, config/alpha/vms.h, config/alpha/elf.h, config/alpha/vms-unwind.h, config/alpha/ev4.md, config/alpha/ev6.md, config/alpha/alpha.c, config/alpha/vms-cc.c, config/alpha/alpha.h, config/alpha/sync.md, config/alpha/openbsd.h, config/alpha/alpha.md, config/alpha/alpha-modes.def, config/alpha/ev5.md, config/alpha/alpha-protos.h, config/alpha/freebsd.h, config/alpha/osf5.h, config/alpha/netbsd.h, config/alpha/vms64.h, config/alpha/constraints.md, config/alpha/osf.h, config/alpha/xm-vms.h, config/alpha/unicosmk.h, config/linux.h, config/frv/predicates.md, config/frv/frv.h, config/frv/linux.h, config/frv/frv.md, config/frv/frv.opt, config/frv/frv-modes.def, config/frv/frv-asm.h, config/frv/frv-protos.h, config/frv/frv-abi.h, config/frv/frv.c, config/s390/tpf.h, config/s390/s390.c, config/s390/predicates.md, config/s390/s390.h, config/s390/linux.h, config/s390/tpf.md, config/s390/tpf.opt, config/s390/2064.md, config/s390/2084.md, config/s390/s390.md, config/s390/s390.opt, config/s390/s390-modes.def, config/s390/fixdfdi.h, config/s390/constraints.md, config/s390/s390-protos.h, config/s390/s390x.h, config/elfos.h, config/dbxcoff.h, config/m32c/predicates.md, config/m32c/cond.md, config/m32c/m32c.c, config/m32c/minmax.md, config/m32c/blkmov.md, config/m32c/m32c-pragma.c, config/m32c/m32c.h, config/m32c/prologue.md, config/m32c/m32c.abi, config/m32c/muldiv.md, config/m32c/bitops.md, config/m32c/mov.md, config/m32c/addsub.md, config/m32c/m32c.md, config/m32c/m32c.opt, config/m32c/t-m32c, config/m32c/m32c-modes.def, config/m32c/jump.md, config/m32c/shift.md, config/m32c/m32c-protos.h, config/libgloss.h, config/spu/spu-protos.h, config/spu/predicates.md, config/spu/spu-builtins.h, config/spu/spu.c, config/spu/spu-builtins.def, config/spu/spu-builtins.md, config/spu/spu.h, config/spu/spu-elf.h, config/spu/constraints.md, config/spu/spu.md, config/spu/spu-c.c, config/spu/spu.opt, config/spu/spu-modes.def, config/spu/t-spu-elf, config/interix.h, config/sparc/hypersparc.md, config/sparc/predicates.md, config/sparc/linux.h, config/sparc/sp64-elf.h, config/sparc/supersparc.md, config/sparc/cypress.md, config/sparc/openbsd1-64.h, config/sparc/openbsd64.h, config/sparc/niagara.md, config/sparc/sparc.md, config/sparc/long-double-switch.opt, config/sparc/ultra3.md, config/sparc/sparc.opt, config/sparc/sync.md, config/sparc/sp-elf.h, config/sparc/sparc-protos.h, config/sparc/ultra1_2.md, config/sparc/biarch64.h, config/sparc/sparc.c, config/sparc/little-endian.opt, config/sparc/sysv4-only.h, config/sparc/sparc.h, config/sparc/linux64.h, config/sparc/freebsd.h, config/sparc/sol2.h, config/sparc/rtemself.h, config/sparc/netbsd-elf.h, config/sparc/vxworks.h, config/sparc/sparc-modes.def, config/sparc/sparclet.md, config/sparc/sysv4.h, config/vx-common.h, config/netbsd-aout.h, config/flat.h, config/m32r/m32r.md, config/m32r/predicates.md, config/m32r/little.h, config/m32r/m32r.c, config/m32r/m32r.opt, config/m32r/linux.h, config/m32r/constraints.md, config/m32r/m32r.h, config/m32r/m32r-protos.h, config/vxworks.opt, config/darwin-c.c, config/darwin.opt, config/i386/i386.h, config/i386/cygming.h, config/i386/linux.h, config/i386/cygwin.h, config/i386/i386.md, config/i386/netware-crt0.c, config/i386/sco5.h, config/i386/mmx.md, config/i386/vx-common.h, config/i386/kaos-i386.h, config/i386/winnt-stubs.c, config/i386/netbsd64.h, config/i386/djgpp.h, config/i386/gas.h, config/i386/sol2.h, config/i386/constraints.md, config/i386/netware-libgcc.c, config/i386/sysv5.h, config/i386/predicates.md, config/i386/geode.md, config/i386/x86-64.h, config/i386/kfreebsd-gnu.h, config/i386/freebsd64.h, config/i386/vxworksae.h, config/i386/pentium.md, config/i386/lynx.h, config/i386/i386elf.h, config/i386/rtemself.h, config/i386/netbsd-elf.h, config/i386/ppro.md, config/i386/k6.md, config/i386/netware.c, config/i386/netware.h, config/i386/i386-modes.def, config/i386/sysv4-cpp.h, config/i386/i386-interix.h, config/i386/cygwin1.c, config/i386/djgpp.opt, config/i386/uwin.h, config/i386/unix.h, config/i386/ptx4-i.h, config/i386/xm-djgpp.h, config/i386/att.h, config/i386/winnt.c, config/i386/beos-elf.h, config/i386/sol2-10.h, config/i386/darwin64.h, config/i386/sse.md, config/i386/i386.opt, config/i386/bsd.h, config/i386/cygming.opt, config/i386/xm-mingw32.h, config/i386/linux64.h, config/i386/openbsdelf.h, config/i386/xm-cygwin.h, config/i386/sco5.opt, config/i386/darwin.h, config/i386/mingw32.h, config/i386/winnt-cxx.c, config/i386/i386-interix3.h, config/i386/nwld.c, config/i386/nwld.h, config/i386/host-cygwin.c, config/i386/cygwin2.c, config/i386/i386-protos.h, config/i386/sync.md, config/i386/openbsd.h, config/i386/host-mingw32.c, config/i386/i386-aout.h, config/i386/nto.h, config/i386/biarch64.h, config/i386/i386-coff.h, config/i386/freebsd.h, config/i386/driver-i386.c, config/i386/knetbsd-gnu.h, config/i386/host-i386-darwin.c, config/i386/vxworks.h, config/i386/crtdll.h, config/i386/i386.c, config/i386/sysv4.h, config/darwin-protos.h, config/linux.opt, config/sol2.c, config/sol2.h, config/sh/symbian.c, config/sh/sh-protos.h, config/sh/linux.h, config/sh/elf.h, config/sh/superh.h, config/sh/sh4.md, config/sh/coff.h, config/sh/newlib.h, config/sh/embed-elf.h, config/sh/symbian-pre.h, config/sh/rtems.h, config/sh/kaos-sh.h, config/sh/sh4a.md, config/sh/constraints.md, config/sh/sh64.h, config/sh/sh.opt, config/sh/symbian-post.h, config/sh/sh-c.c, config/sh/predicates.md, config/sh/sh.c, config/sh/sh.h, config/sh/shmedia.md, config/sh/sh-modes.def, config/sh/little.h, config/sh/sh1.md, config/sh/sh4-300.md, config/sh/superh64.h, config/sh/rtemself.h, config/sh/netbsd-elf.h, config/sh/sh.md, config/sh/vxworks.h, config/usegas.h, config/svr3.h, config/pdp11/pdp11-protos.h, config/pdp11/2bsd.h, config/pdp11/pdp11.md, config/pdp11/pdp11.c, config/pdp11/pdp11.opt, config/pdp11/pdp11-modes.def, config/pdp11/pdp11.h, config/avr/rtems.h, config/avr/avr-protos.h, config/avr/predicates.md, config/avr/constraints.md, config/avr/avr.md, config/avr/avr.c, config/avr/avr.opt, config/avr/avr.h, config/sol2-protos.h, config/dbxelf.h, config/lynx.opt, config/crx/crx.h, config/crx/crx-protos.h, config/crx/crx.md, config/crx/crx.c, config/crx/crx.opt, config/c4x/c4x-c.c, config/c4x/c4x.c, config/c4x/c4x.opt, config/c4x/c4x-modes.def, config/c4x/rtems.h, config/c4x/predicates.md, config/c4x/c4x.h, config/c4x/c4x-protos.h, config/c4x/c4x.md, config/kfreebsd-gnu.h, config/xtensa/predicates.md, config/xtensa/xtensa.c, config/xtensa/linux.h, config/xtensa/xtensa.h, config/xtensa/elf.h, config/xtensa/xtensa.md, config/xtensa/xtensa.opt, config/xtensa/constraints.md, config/xtensa/xtensa-protos.h, config/dbx.h, config/stormy16/predicates.md, config/stormy16/stormy16.md, config/stormy16/stormy16.c, config/stormy16/stormy16.opt, config/stormy16/stormy16.h, config/stormy16/stormy16-protos.h, config/host-solaris.c, config/fr30/fr30.h, config/fr30/predicates.md, config/fr30/fr30-protos.h, config/fr30/fr30.md, config/fr30/fr30.c, config/fr30/fr30.opt, config/vxworksae.h, config/sol2-c.c, config/lynx.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/predicates.md, config/m68hc11/m68hc11.md, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.opt, config/m68hc11/m68hc11.h, config/m68hc11/m68hc12.h, config/openbsd-oldgas.h, config/host-linux.c, config/interix3.h, config/cris/cris.c, config/cris/predicates.md, config/cris/linux.h, config/cris/cris.h, config/cris/aout.h, config/cris/cris.md, config/cris/linux.opt, config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt, config/cris/cris-protos.h, config/vxworks-dummy.h, config/netbsd.h, config/netbsd-elf.h, config/iq2000/iq2000.h, config/iq2000/predicates.md, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.md, config/iq2000/iq2000.c, config/iq2000/iq2000.opt, config/host-darwin.c, config/mt/mt.md, config/mt/mt.c, config/mt/mt.opt, config/mt/t-mt, config/mt/mt.h, config/mt/mt-protos.h, config/svr4.h, config/host-darwin.h, config/chorus.h, config/mn10300/mn10300.c, config/mn10300/mn10300.opt, config/mn10300/predicates.md, config/mn10300/mn10300.h, config/mn10300/linux.h, config/mn10300/constraints.md, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.md, config/ia64/predicates.md, config/ia64/itanium1.md, config/ia64/unwind-ia64.h, config/ia64/ia64-c.c, config/ia64/sync.md, config/ia64/ia64.c, config/ia64/itanium2.md, config/ia64/ia64.h, config/ia64/vect.md, config/ia64/freebsd.h, config/ia64/ia64.md, config/ia64/ia64-modes.def, config/ia64/constraints.md, config/ia64/hpux.h, config/ia64/ia64-protos.h, config/windiss.h, config/gofast.h, config/rtems.h, config/sol2-10.h, config/m68k/predicates.md, config/m68k/m68k.md, config/m68k/linux.h, config/m68k/m68k-modes.def, config/m68k/print-sysroot-suffix.sh, config/m68k/m68k-protos.h, config/m68k/coff.h, config/m68k/m68k-none.h, config/m68k/ieee.opt, config/m68k/openbsd.h, config/m68k/m68k-aout.h, config/m68k/m68k.opt, config/m68k/m68020-elf.h, config/m68k/m68kelf.h, config/m68k/m68k-devices.def, config/m68k/uclinux-oldabi.h, config/m68k/m68k.c, config/m68k/constraints.md, config/m68k/rtemself.h, config/m68k/netbsd-elf.h, config/m68k/m68k.h, config/m68k/uclinux.h, config/rs6000/power4.md, config/rs6000/host-darwin.c, config/rs6000/6xx.md, config/rs6000/linux.h, config/rs6000/eabi.h, config/rs6000/aix41.opt, config/rs6000/xcoff.h, config/rs6000/secureplt.h, config/rs6000/linuxspe.h, config/rs6000/eabialtivec.h, config/rs6000/8540.md, config/rs6000/darwin8.h, config/rs6000/kaos-ppc.h, config/rs6000/windiss.h, config/rs6000/603.md, config/rs6000/aix41.h, config/rs6000/cell.md, config/rs6000/mpc.md, config/rs6000/aix43.h, config/rs6000/beos.h, config/rs6000/gnu.h, config/rs6000/rtems.h, config/rs6000/aix.opt, config/rs6000/darwin.md, config/rs6000/darwin64.h, config/rs6000/default64.h, config/rs6000/7xx.md, config/rs6000/darwin.opt, config/rs6000/spe.md, config/rs6000/rs6000.opt, config/rs6000/rs6000-c.c, config/rs6000/rios2.md, config/rs6000/linuxaltivec.h, config/rs6000/7450.md, config/rs6000/linux64.h, config/rs6000/constraints.md, config/rs6000/440.md, config/rs6000/darwin.h, config/rs6000/host-ppc64-darwin.c, config/rs6000/rs6000.c, config/rs6000/aix52.h, config/rs6000/rs6000.h, config/rs6000/power6.md, config/rs6000/predicates.md, config/rs6000/altivec.md, config/rs6000/aix64.opt, config/rs6000/rios1.md, config/rs6000/rs6000-modes.def, config/rs6000/rs64.md, config/rs6000/eabisim.h, config/rs6000/sysv4le.h, config/rs6000/darwin7.h, config/rs6000/dfp.md, config/rs6000/linux64.opt, config/rs6000/sync.md, config/rs6000/vxworksae.h, config/rs6000/power5.md, config/rs6000/lynx.h, config/rs6000/biarch64.h, config/rs6000/rs6000.md, config/rs6000/sysv4.opt, config/rs6000/eabispe.h, config/rs6000/e500.h, config/rs6000/freebsd.h, config/rs6000/rs6000-protos.h, config/rs6000/netbsd.h, config/rs6000/e500-double.h, config/rs6000/aix.h, config/rs6000/vxworks.h, config/rs6000/40x.md, config/rs6000/aix51.h, config/rs6000/sysv4.h, config/arc/arc-protos.h, config/arc/arc.md, config/arc/arc.c, config/arc/arc.opt, config/arc/arc-modes.def, config/arc/arc.h, config/mcore/mcore-elf.h, config/mcore/mcore-protos.h, config/mcore/predicates.md, config/mcore/mcore.md, config/mcore/mcore.c, config/mcore/mcore.opt, config/mcore/mcore.h, config/mcore/mcore-pe.h, config/darwin.c, config/freebsd-nthr.h, config/score/predicates.md, config/score/score-version.h, config/score/score-protos.h, config/score/misc.md, config/score/elf.h, config/score/score.c, config/score/mac.md, config/score/score7.md, config/score/score.h, config/score/score-conv.h, config/score/score-mdaux.c, config/score/score.md, config/score/score.opt, config/score/score-modes.def, config/score/score-mdaux.h, config/score/mul-div.S, config/arm/uclinux-elf.h, config/arm/semi.h, config/arm/ecos-elf.h, config/arm/arm1020e.md, config/arm/symbian.h, config/arm/linux-elf.h, config/arm/arm1026ejs.md, config/arm/arm1136jfs.md, config/arm/elf.h, config/arm/aout.h, config/arm/arm.c, config/arm/thumb2.md, config/arm/vec-common.md, config/arm/coff.h, config/arm/strongarm-pe.h, config/arm/arm.h, config/arm/cortex-a8-neon.md, config/arm/semiaof.h, config/arm/cortex-a8.md, config/arm/uclinux-eabi.h, config/arm/arm-modes.def, config/arm/linux-eabi.h, config/arm/rtems-elf.h, config/arm/neon-schedgen.ml, config/arm/arm-cores.def, config/arm/arm-protos.h, config/arm/vfp.md, config/arm/aof.h, config/arm/linux-gas.h, config/arm/wince-pe.h, config/arm/neon.md, config/arm/constraints.md, config/arm/neon.ml, config/arm/xscale-elf.h, config/arm/strongarm-coff.h, config/arm/arm.opt, config/arm/arm926ejs.md, config/arm/predicates.md, config/arm/iwmmxt.md, config/arm/arm_neon.h, config/arm/unknown-elf.h, config/arm/kaos-arm.h, config/arm/bpabi.h, config/arm/pe.opt, config/arm/neon-testgen.ml, config/arm/arm.md, config/arm/xscale-coff.h, config/arm/pe.c, config/arm/arm-generic.md, config/arm/pe.h, config/arm/kaos-strongarm.h, config/arm/freebsd.h, config/arm/neon-docgen.ml, config/arm/netbsd.h, config/arm/fpa.md, config/arm/strongarm-elf.h, config/arm/cirrus.md, config/arm/netbsd-elf.h, config/arm/vxworks.h, config/arm/neon-gen.ml, config/kaos.h, config/darwin-driver.c, config/pa/predicates.md, config/pa/pa64-hpux.h, config/pa/pa-hpux.opt, config/pa/som.h, config/pa/pa-hpux1010.opt, config/pa/pa-hpux1111.opt, config/pa/pa-pro-end.h, config/pa/elf.h, config/pa/fptr.c, config/pa/pa64-linux.h, config/pa/pa.md, config/pa/pa.opt, config/pa/pa-hpux.h, config/pa/pa-hpux10.h, config/pa/pa-hpux11.h, config/pa/pa-hpux1010.h, config/pa/pa-protos.h, config/pa/pa-osf.h, config/pa/pa-hpux1111.h, config/pa/pa-64.h, config/pa/milli64.S, config/pa/pa.c, config/pa/pa-linux.h, config/pa/pa.h, config/pa/pa32-linux.h, config/pa/pa64-hpux.opt, config/pa/pa64-regs.h, config/pa/pa-modes.def, config/pa/constraints.md, config/darwin9.h, config/mips/4100.md, config/mips/linux.h, config/mips/elfoabi.h, config/mips/elf.h, config/mips/sdb.h, config/mips/windiss.h, config/mips/rtems.h, config/mips/3000.md, config/mips/iris5.h, config/mips/5000.md, config/mips/7000.md, config/mips/9000.md, config/mips/4600.md, config/mips/linux64.h, config/mips/elforion.h, config/mips/constraints.md, config/mips/generic.md, config/mips/predicates.md, config/mips/4300.md, config/mips/mips-ps-3d.md, config/mips/iris.h, config/mips/24k.md, config/mips/mips.md, config/mips/mips.opt, config/mips/4k.md, config/mips/5k.md, config/mips/vr4120-div.S, config/mips/openbsd.h, config/mips/iris6.h, config/mips/4000.md, config/mips/mips-protos.h, config/mips/6000.md, config/mips/mips.c, config/mips/mips.h, config/mips/r3900.h, config/mips/74k.md, config/mips/netbsd.h, config/mips/vxworks.h, config/mips/mips-modes.def, config/mips/vr.h, config/soft-fp/t-softfp, config/openbsd.h, config/ptx4.h, config/freebsd-spec.h, config/vax/vax.c, config/vax/openbsd.h, config/vax/vax.h, config/vax/elf.h, config/vax/vax.md, config/vax/bsd.h, config/vax/vax.opt, config/vax/vax-modes.def, config/vax/openbsd1.h, config/vax/netbsd.h, config/vax/vax-protos.h, config/vax/netbsd-elf.h, config/vax/vaxv.h, config/vax/ultrix.h, config/freebsd.h, config/h8300/rtems.h, config/h8300/predicates.md, config/h8300/h8300.c, config/h8300/h8300.h, config/h8300/elf.h, config/h8300/h8300.md, config/h8300/h8300.opt, config/h8300/coff.h, config/h8300/h8300-protos.h, config/v850/v850.md, config/v850/predicates.md, config/v850/v850-c.c, config/v850/v850.c, config/v850/v850.opt, config/v850/v850.h, config/v850/v850-protos.h, config/vxworks.c, config/knetbsd-gnu.h, config/sol2-6.h, config/vxworks.h, config/mmix/mmix.h, config/mmix/predicates.md, config/mmix/mmix-protos.h, config/mmix/mmix.md, config/mmix/mmix.c, config/mmix/mmix.opt, config/mmix/mmix-modes.def, config/bfin/bfin.opt, config/bfin/rtems.h, config/bfin/bfin-modes.def, config/bfin/predicates.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/bfin/bfin.h, config/bfin/bfin.md: Likewise. From-SVN: r127157
2007-08-02 12:49:31 +02:00
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
2000-03-09 01:26:04 +01:00
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
2000-03-09 01:26:04 +01:00
#include "rtl.h"
#include "tree.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
#include "expr.h"
expr.h: Split out optab- and libfunc-related code to... * expr.h: Split out optab- and libfunc-related code to... * optabs.h, libfuncs.h: ... these new headers. * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h. (OPTABS_H): New. (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to dependencies. * mkconfig.sh: Don't include insn-codes.h from config.h. * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether enum insn_code is available. Move reload_in_optab and reload_out_optab array declarations to optabs.h. * regmove.c (gen_add3_insn): Move to optabs.c, export from there, prototype in expr.h. * gencodes.c: Cleanup: zap global variables, don't use printf where puts will do, don't bother defining MAX_INSN_CODE which nothing uses, let CODE_FOR_nothing get its value implicitly. * genemit.c, genopinit.c: Include optabs.h in generated file. * genoutput.c: Include insn-codes.h in generated file. * builtins.c, caller-save.c, combine.c, doloop.c, explow.c, expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c, reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c, config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c, config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c: Include optabs.h. * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c, optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c, config/m88k/m88k.c, config/sparc/sparc.c: Include libfuncs.h. * reload.c: Include expr.h and optabs.h before reload.h. * config/alpha/alpha.c: Include tree.h before reload.h. * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h, and reload.h in that order. * config/sparc/sparc.c: Include debug.h. * recog.c: Include insn-codes.h. cp: * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. * except.c: Include libfuncs.h. java: * Make-lang.in (java/decl.o): Update dependencies. * decl.c: Include libfuncs.h, don't include toplev.h. From-SVN: r44858
2001-08-13 17:56:51 +02:00
#include "optabs.h"
2000-03-09 01:26:04 +01:00
#include "except.h"
#include "function.h"
#include "ggc.h"
#include "basic-block.h"
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
#include "libfuncs.h"
#include "toplev.h"
#include "sched-int.h"
#include "timevar.h"
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
#include "target.h"
#include "target-def.h"
#include "tm_p.h"
#include "hashtab.h"
#include "langhooks.h"
#include "cfglayout.h"
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
#include "gimple.h"
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
#include "intl.h"
#include "df.h"
2006-02-04 23:08:04 +01:00
#include "debug.h"
#include "params.h"
#include "dbgcnt.h"
#include "tm-constrs.h"
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#include "sel-sched.h"
2000-03-09 01:26:04 +01:00
/* This is used for communication between ASM_OUTPUT_LABEL and
ASM_OUTPUT_LABELREF. */
int ia64_asm_output_label = 0;
/* Register names for ia64_expand_prologue. */
static const char * const ia64_reg_numbers[96] =
2000-03-09 01:26:04 +01:00
{ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
"r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
"r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
"r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
"r64", "r65", "r66", "r67", "r68", "r69", "r70", "r71",
"r72", "r73", "r74", "r75", "r76", "r77", "r78", "r79",
"r80", "r81", "r82", "r83", "r84", "r85", "r86", "r87",
"r88", "r89", "r90", "r91", "r92", "r93", "r94", "r95",
"r96", "r97", "r98", "r99", "r100","r101","r102","r103",
"r104","r105","r106","r107","r108","r109","r110","r111",
"r112","r113","r114","r115","r116","r117","r118","r119",
"r120","r121","r122","r123","r124","r125","r126","r127"};
/* ??? These strings could be shared with REGISTER_NAMES. */
static const char * const ia64_input_reg_names[8] =
2000-03-09 01:26:04 +01:00
{ "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7" };
/* ??? These strings could be shared with REGISTER_NAMES. */
static const char * const ia64_local_reg_names[80] =
2000-03-09 01:26:04 +01:00
{ "loc0", "loc1", "loc2", "loc3", "loc4", "loc5", "loc6", "loc7",
"loc8", "loc9", "loc10","loc11","loc12","loc13","loc14","loc15",
"loc16","loc17","loc18","loc19","loc20","loc21","loc22","loc23",
"loc24","loc25","loc26","loc27","loc28","loc29","loc30","loc31",
"loc32","loc33","loc34","loc35","loc36","loc37","loc38","loc39",
"loc40","loc41","loc42","loc43","loc44","loc45","loc46","loc47",
"loc48","loc49","loc50","loc51","loc52","loc53","loc54","loc55",
"loc56","loc57","loc58","loc59","loc60","loc61","loc62","loc63",
"loc64","loc65","loc66","loc67","loc68","loc69","loc70","loc71",
"loc72","loc73","loc74","loc75","loc76","loc77","loc78","loc79" };
/* ??? These strings could be shared with REGISTER_NAMES. */
static const char * const ia64_output_reg_names[8] =
2000-03-09 01:26:04 +01:00
{ "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7" };
/* Which cpu are we scheduling for. */
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
enum processor_type ia64_tune = PROCESSOR_ITANIUM2;
/* Determines whether we run our final scheduling pass or not. We always
avoid the normal second scheduling pass. */
static int ia64_flag_schedule_insns2;
Josef Zlomek <zlomekj@suse.cz> Josef Zlomek <zlomekj@suse.cz> * Makefile.in (var-tracking.o): New. * common.opt (fvar-tracking): New. * flags.h (flag_var_tracking): New. * gengtype.c (adjust_field_rtx_def): NOTE_INSN_VAR_LOCATION was added. * opts.c (common_handle_option): Add OPT_fvar_tracking. * print-rtl.c (print_rtx): NOTE_INSN_VAR_LOCATION was added. * rtl.c (note_insn_name): Likewise. * rtl.def (VAR_LOCATION): New. * rtl.h (NOTE_VAR_LOCATION): New. (NOTE_VAR_LOCATION_DECL): New. (NOTE_VAR_LOCATION_LOC): New. (enum insn_note): NOTE_INSN_VAR_LOCATION was added. (variable_tracking_main): New exported function. * timevar.def (TV_VAR_TRACKING): New. * toplev.c (enum dump_file_index): Added DFI_vartrack. (dump_file): "vartrack" was added (-dV). (flag_var_tracking): New. (f_options): "var-tracking" was added. (rest_of_handle_variable_tracking): New function. (rest_of_compilation): Run variable tracking. (process_options): If user has not specified flag_var_tracking set it according to optimize, debug_info_level and debug_hooks. * tree.h (frame_base_decl): New. * var-tracking.c: New file. * config/ia64/ia64.c (ia64_flag_var_tracking): New variable. (ia64_override_options): Set flags to run variable tracking in machine dependent reorg instead of toplev.c. (ia64_reorg): Run variable tracking if wanted. * doc/invoke.texi: Mention variable tracking in -dV, add and -fvar-tracking. * doc/passes.texi: Added variable tracking pass. Daniel Berlin <dberlin@dberlin.org> * debug.h (struct gcc_debug_hooks): Added var_location debug hook. * dbxout.c (dbx_debug_hooks): Likewise. (xcoff_debug): Likewise. * debug.c (do_nothing_debug_hooks): Likewise. * dwarf2out.c (dwarf2_debug_hooks): Likewise. * dwarfout.c (dwarf_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * final.c (final_scan_insn): Call var_location debug hook for each NOTE_INSN_VAR_LOCATION. Co-Authored-By: Daniel Berlin <dberlin@dberlin.org> From-SVN: r77418
2004-02-06 21:03:45 +01:00
/* Determines whether we run variable tracking in machine dependent
reorganization. */
static int ia64_flag_var_tracking;
2000-03-09 01:26:04 +01:00
/* Variables which are this size or smaller are put in the sdata/sbss
sections. */
unsigned int ia64_section_threshold;
/* The following variable is used by the DFA insn scheduler. The value is
TRUE if we do insn bundling instead of insn scheduling. */
int bundling_p = 0;
enum ia64_frame_regs
{
reg_fp,
reg_save_b0,
reg_save_pr,
reg_save_ar_pfs,
reg_save_ar_unat,
reg_save_ar_lc,
reg_save_gp,
number_of_ia64_frame_regs
};
/* Structure to be filled in by ia64_compute_frame_size with register
save masks and offsets for the current function. */
struct ia64_frame_info
{
HOST_WIDE_INT total_size; /* size of the stack frame, not including
the caller's scratch area. */
HOST_WIDE_INT spill_cfa_off; /* top of the reg spill area from the cfa. */
HOST_WIDE_INT spill_size; /* size of the gr/br/fr spill area. */
HOST_WIDE_INT extra_spill_size; /* size of spill area for others. */
HARD_REG_SET mask; /* mask of saved registers. */
unsigned int gr_used_mask; /* mask of registers in use as gr spill
registers or long-term scratches. */
int n_spilled; /* number of spilled registers. */
int r[number_of_ia64_frame_regs]; /* Frame related registers. */
int n_input_regs; /* number of input registers used. */
int n_local_regs; /* number of local registers used. */
int n_output_regs; /* number of output registers used. */
int n_rotate_regs; /* number of rotating registers used. */
char need_regstk; /* true if a .regstk directive needed. */
char initialized; /* true if the data is finalized. */
};
/* Current frame information calculated by ia64_compute_frame_size. */
static struct ia64_frame_info current_frame_info;
/* The actual registers that are emitted. */
static int emitted_frame_related_regs[number_of_ia64_frame_regs];
static int ia64_first_cycle_multipass_dfa_lookahead (void);
static void ia64_dependencies_evaluation_hook (rtx, rtx);
static void ia64_init_dfa_pre_cycle_insn (void);
static rtx ia64_dfa_pre_cycle_insn (void);
static int ia64_first_cycle_multipass_dfa_lookahead_guard (rtx);
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
static bool ia64_first_cycle_multipass_dfa_lookahead_guard_spec (const_rtx);
static int ia64_dfa_new_cycle (FILE *, int, rtx, int, int, int *);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static void ia64_h_i_d_extended (void);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
static void * ia64_alloc_sched_context (void);
static void ia64_init_sched_context (void *, bool);
static void ia64_set_sched_context (void *);
static void ia64_clear_sched_context (void *);
static void ia64_free_sched_context (void *);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static int ia64_mode_to_int (enum machine_mode);
static void ia64_set_sched_flags (spec_info_t);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
static ds_t ia64_get_insn_spec_ds (rtx);
static ds_t ia64_get_insn_checked_ds (rtx);
static bool ia64_skip_rtx_p (const_rtx);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static int ia64_speculate_insn (rtx, ds_t, rtx *);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
static bool ia64_needs_block_p (int);
static rtx ia64_gen_spec_check (rtx, rtx, ds_t);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static int ia64_spec_check_p (rtx);
static int ia64_spec_check_src_p (rtx);
static rtx gen_tls_get_addr (void);
static rtx gen_thread_pointer (void);
static int find_gr_spill (enum ia64_frame_regs, int);
static int next_scratch_gr_reg (void);
static void mark_reg_gr_used_mask (rtx, void *);
static void ia64_compute_frame_size (HOST_WIDE_INT);
static void setup_spill_pointers (int, rtx, HOST_WIDE_INT);
static void finish_spill_pointers (void);
static rtx spill_restore_mem (rtx, HOST_WIDE_INT);
static void do_spill (rtx (*)(rtx, rtx, rtx), rtx, HOST_WIDE_INT, rtx);
static void do_restore (rtx (*)(rtx, rtx, rtx), rtx, HOST_WIDE_INT);
static rtx gen_movdi_x (rtx, rtx, rtx);
static rtx gen_fr_spill_x (rtx, rtx, rtx);
static rtx gen_fr_restore_x (rtx, rtx, rtx);
hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.c (hook_bool_const_int_const_int_true): New function. * target.h (struct gcc_target): Add can_eliminate field. * target-def.h (TARGET_CAN_ELIMINATE): Define. (TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE. * ira.c (setup_eliminable_regset): Use can_eliminate target hook. * reload1.c (update_eliminables, init_elim_table): (Ditto.). (elim_table): Revise comment. * system.h (CAN_ELIMINATE): Poison. * defaults.h (CAN_ELIMINATE): Remove. * doc/tm.texi (CAN_ELIMINATE): Revise documentation. * config/alpha/vms.h (CAN_ELIMINATE): Remove macro. * config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]: Define macro. (alpha_vms_can_eliminate): Declare as static, change return type to bool. * config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove. * config/arm/arm.h (CAN_ELIMINATE): Remove macro. * config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro. (arm_can_eliminate): New function. * config/avr/avr.h (CAN_ELIMINATE): Remove macro. * config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro. (avr_can_eliminate): Declare as static. * config/avr/avr-protos.h (avr_can_eliminate): Remove. * config/bfin/bfin.h (CAN_ELIMINATE): Remove macro. * config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro. (bfin_can_eliminate): New function. * config/crx/crx.h (CAN_ELIMINATE): Remove macro. * config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro. (crx_can_eliminate): New function. * config/fr30/fr30.h (CAN_ELIMINATE): Remove macro. * config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro. (fr30_can_eliminate): New function. * config/frv/frv.h (CAN_ELIMINATE): Remove macro. * config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro. (frv_can_eliminate): New function. * config/h8300/h8300.h (CAN_ELIMINATE): Remove macro. * config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro. (h8300_can_eliminate): New function. * config/i386/i386.h (CAN_ELIMINATE): Remove macro. * config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro. (i386_can_eliminate): Declare as static, change return type to bool. * config/i386/i386-protos.h (i386_can_eliminate): Remove. * config/ia64/ia64.h (CAN_ELIMINATE): Remove macro. * config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro. (ia64_can_eliminate): New function. * config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro. * config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro. (iq2000_can_eliminate): New function. * config/m32r/m32r.h (CAN_ELIMINATE): Remove macro. * config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro. (m32r_can_eliminate): New function. * config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro. * config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro. (m68hc11_can_eliminate): New function. * config/m68k/m68k.h (CAN_ELIMINATE): Remove macro. * config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro. (m68k_can_eliminate): New function. * config/mep/mep.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro. (mep_can_eliminate): New function. * config/mips/mips.h (CAN_ELIMINATE): Remove macro. * config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro. (mips_can_eliminate): New function. * config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro. * config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro. (rs6000_can_eliminate): New function. * config/s390/s390.h (CAN_ELIMINATE): Remove macro. * config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro. (s390_can_eliminate): Declare as static. * config/s390/s390-protos.h (sparc_can_eliminate): Remove. * config/score/score.h (CAN_ELIMINATE): Remove macro. * config/score/score.c (TARGET_CAN_ELIMINATE): Define macro. (score_can_eliminate): New function. * config/sparc/sparc.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro. (sparc_can_eliminate): Declare as static. * config/sparc/sparc-protos.h (sparc_can_eliminate): Remove. * config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro. * config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro. (xstormy16_can_eliminate): New function. * config/v850/v850.h (CAN_ELIMINATE): Remove macro. * config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro. (v850_can_eliminate): New function. From-SVN: r151096
2009-08-25 23:09:00 +02:00
static bool ia64_can_eliminate (const int, const int);
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
static enum machine_mode hfa_element_mode (const_tree, bool);
static void ia64_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
tree, int *, int);
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static bool ia64_function_ok_for_sibcall (tree, tree);
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
static bool ia64_return_in_memory (const_tree, const_tree);
fwprop.c (should_replace_address): Add speed attribute. * fwprop.c (should_replace_address): Add speed attribute. (PR_OPTIMIZE_FOR_SPEED): New flag. (propagate_rtx_1): Use it. (propagate_rtx): Set it. (try_fwprop_subst): Update call of rtx_costs. (forward_propagate_and_simplify): LIkewise. * hooks.c (hook_int_rtx_bool_0): New (hook_bool_rtx_int_int_intp_false): Replace by ... (hook_bool_rtx_int_int_intp_bool_false): .. thisone. * hooks.h (hook_int_rtx_bool_0): New (hook_bool_rtx_int_int_intp_false): Replace by ... (hook_bool_rtx_int_int_intp_bool_false): .. thisone. * optabs.c (avoid_expensive_constant): UPdate call of rtx_cost. (prepare_cmp_insn): UPdate call of rtx_cost. * postreload.c (reload_cse_simplify_set): Update call of rtx_cost. (reload_cse_simplify_operands): Update call of rtx_cost. (reload_cse_move2add): call of rtx_cost. * target.h (struct gcc_target): Update rtx_costs and address_costs. * rtlanal.c (rtx_cost): Add speed argument. (address_cost): Add speed argument (default_address_cost): Likewise. (insn_rtx_cost): Likewise. * cfgloopanal.c (seq_cost): Add speed argument. (target_reg_cost, target_spill_cost): Turn to array. (init_set_costs): Update for speed. (estimate_reg_pressure_cost): Add speed argument. * auto-inc-dec.c (attempt_change): Update call of rtx_cost. * dojump.c (prefer_and_bit_test): UPdate call of rtx_cost. * tree-ssa-loop-ivopts.c (struct ivopts_data): New field speed. (seq_cost): Add speed argument. (computation_cost): Add speed arugment. (add_cost, multiply_by_const, get_address_cost): add speed argument. (force_expr_to_var_cost): Update for profile info. (force_var_cost): Likewise. (split_address_cost): Likewise. (ptr_difference_cost): Likewise. (difference_cost): Likewise. (get_computation_cost_at): Likewise. (determine_iv_cost): Likewise. (ivopts_global_cost_for_size): Likewise. (rewrite_use_address): Likewise. (tree_ssa_iv_optimize_loop): Initialize speed field. * cse.c (optimize_this_for_speed_p): New static var. (notreg_cost): Update call of rtx_cost. (cse_extended_basic_block): set optimize_this_for_speed_p. * ifcvt.c (cheap_bb_rtx_cost_p): Update call of rtx_cost. (noce_try_cmove_arith): Likewise. (noce_try_sign_mask): LIkewise. * expr.c (compress_float_constant): Update rtx_cost calls. * tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument. (addr_to_parts): Likewise. (create_mem_ref): Likewise. * dse.c (find_shift_sequence): Add speed argument. (replace_read): Update call. * calls.c (precompute_register_parameters): Update call of rtx_cost. * expmed.c (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, * neg_cost, shift_cost, shiftadd_cost, shiftsub_cost, mul_cost, sdiv_cost, udiv_cost ,mul_widen_cost, mul_highpart_cost): Increase dimension. (init_expmed): Initialize for both size and speed. (expand_shift): Use profile. (synth_mult): Use profile. (choose_mult_variant): Use profile. (expand_mult): Use profile. (expand_mult_highpart_optab): Use profile. (expand_mult_highpart): Use profile. (expand_smod_pow2): Use profile. (expand_divmod): Use profile. * simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost. * loop-invariant.c (create_new_invariant): Use profile. (gain_for_invariant): Add speed parameter. (best_gain_for_invariant): Likewise. (find_invariants_to_move): Likewise. (move_single_loop_invariants): Set it. * target-def.h (TARGET_RTX_COSTS): Use hook. * rtl.h (rtx_cost, address_cost, insn_rtx_cost): Update prototpe. (optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare. * output.h (default_address_cost): Update prototype. * combine.c (optimize_this_for_speed_p): New static var. (combine_validate_cost): Update call of rtx_cost. (combine_instructions): Set optimize_this_for_speed_p. (expand_compound_operation): Update call of rtx_cost. (make_extraction):Update call of rtx_cost. (force_to_mode):Update call of rtx_cost. (distribute_and_simplify_rtx):Update call of rtx_cost. * cfgloop.h (target_reg_cost, target_spill_cost): Turn to array. (estimate_reg_pressure_cost): Update prototype. * tree-flow.h (multiply_by_cost, create_mem_ref): Update prototype. * basic-block.h (optimize_insn_for_size_p, optimize_insn_for_speed_p): Remove. * config/alpha/alpha.c (alpha_rtx_costs): Update. (alpha_rtx_costs): Update. * config/frv/frv.c (frv_rtx_costs): Update. * config/s390/s390.c (s390_rtx_costs): Update. * config/m32c/m32c.c (m32c_memory_move_cost): Update. (m32c_rtx_costs): Update. * config/spu/spu.c (TARGET_ADDRESS_COST): Upate. (spu_rtx_costs): Update. * config/sparc/sparc.c (sparc_rtx_costs): Update. * config/m32r/m32r.c (m32r_rtx_costs): Update. * config/i386/i386.c (:ix86_address_cost): Update. (ix86_rtx_costs): Update. * config/sh/sh.c (sh_rtx_costs, sh_address_cost): Update. * config/pdp11/pdp11.c (pdp11_rtx_costs): Update. * config/avr/avr.c (avr_rtx_costs, avr_address_cost): Update. * config/crx/crx.c (crx_address_cost): Update. * config/xtensa/xtensa.c (xtensa_rtx_costs): Update. * config/stormy16/stormy16.c (xstormy16_address_cost, xstormy16_rtx_costs): Update. * config/m68hc11/m68hc11.c (m68hc11_address_cost, m68hc11_rtx_costs): Update. * config/cris/cris.c (cris_rtx_costs, cris_address_cost): Update. * config/iq2000/iq2000.c (iq2000_rtx_costs, iq2000_address_cost): Update. * config/mn10300/mn10300.c (mn10300_address_cost, mn10300_rtx_costs): Update * config/ia64/ia64.c (ia64_rtx_costs): Update. * config/m68k/m68k.c (m68k_rtx_costs): Update. * config/rs6000/rs6000.c (rs6000_rtx_costs): Update. * config/arc/arc.c (arc_rtx_costs, arc_address_cost): Update. * config/mcore/mcore.c (TARGET_ADDRESS_COST): Update. (mcore_rtx_costs): update. * config/score/score3.c (score3_rtx_costs): Update. * config/score/score7.c (score7_rtx_costs): Update. * config/score/score3.h (score3_rtx_costs):Update. * config/score/score7.h (score7_rtx_costs): Update. * config/score/score.c (score_rtx_costs): Update. * config/arm/arm.c (arm_address_cost): Update. (arm_rtx_costs_1): Update. (arm_rtx_costs_1): Update. (arm_size_rtx_costs): Update. (arm_size_rtx_costs): Update. (arm_size_rtx_costs): Update. (arm_xscale_rtx_costs): Update. (arm_thumb_address_cost): Update. * config/pa/pa.c (hppa_address_cost): Update. * config/mips/mips.c (mips_rtx_costs): Update. * config/vax/vax.c (vax_address_cost): Update. * config/h8300/h8300.c (h8300_shift_costs): Update. (h8300_rtx_costs): Update. * config/v850/v850.c (TARGET_ADDRESS_COST): Update. (v850_rtx_costs): Update. * config/mmix/mmix.c (mmix_rtx_costs, mmix_rtx_costs): Update. * config/bfin/bfin.c (bfin_address_cost): Update. (bfin_rtx_costs): Update. * stmt.c (lshift_cheap_p): Update. From-SVN: r139821
2008-08-31 11:44:25 +02:00
static bool ia64_rtx_costs (rtx, int, int, int *, bool);
static int ia64_unspec_may_trap_p (const_rtx, unsigned);
static void fix_range (const char *);
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
static bool ia64_handle_option (size_t, const char *, int);
static struct machine_function * ia64_init_machine_status (void);
static void emit_insn_group_barriers (FILE *);
static void emit_all_insn_group_barriers (FILE *);
static void final_emit_insn_group_barriers (FILE *);
static void emit_predicate_relation_info (void);
static void ia64_reorg (void);
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
static bool ia64_in_small_data_p (const_tree);
2006-02-04 23:08:04 +01:00
static void process_epilogue (FILE *, rtx, bool, bool);
static int process_set (FILE *, rtx, rtx, bool, bool);
static bool ia64_assemble_integer (rtx, unsigned int, int);
static void ia64_output_function_prologue (FILE *, HOST_WIDE_INT);
static void ia64_output_function_epilogue (FILE *, HOST_WIDE_INT);
static void ia64_output_function_end_prologue (FILE *);
static int ia64_issue_rate (void);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
static int ia64_adjust_cost_2 (rtx, int, rtx, int, dw_t);
static void ia64_sched_init (FILE *, int, int);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static void ia64_sched_init_global (FILE *, int, int);
static void ia64_sched_finish_global (FILE *, int);
static void ia64_sched_finish (FILE *, int);
static int ia64_dfa_sched_reorder (FILE *, int, rtx *, int *, int, int);
static int ia64_sched_reorder (FILE *, int, rtx *, int *, int);
static int ia64_sched_reorder2 (FILE *, int, rtx *, int *, int);
static int ia64_variable_issue (FILE *, int, rtx, int);
static struct bundle_state *get_free_bundle_state (void);
static void free_bundle_state (struct bundle_state *);
static void initiate_bundle_states (void);
static void finish_bundle_states (void);
static unsigned bundle_state_hash (const void *);
static int bundle_state_eq_p (const void *, const void *);
static int insert_bundle_state (struct bundle_state *);
static void initiate_bundle_state_table (void);
static void finish_bundle_state_table (void);
static int try_issue_nops (struct bundle_state *, int);
static int try_issue_insn (struct bundle_state *, rtx);
static void issue_nops_and_insn (struct bundle_state *, int, rtx, int, int);
static int get_max_pos (state_t);
static int get_template (state_t, int);
static rtx get_next_important_insn (rtx, rtx);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
static bool important_for_bundling_p (rtx);
static void bundling (FILE *, int, rtx, rtx);
static void ia64_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
static void ia64_file_start (void);
static void ia64_globalize_decl_name (FILE *, tree);
re PR target/26090 (IA-64 creates DT_TEXTREL binaries) PR target/26090 * target.h (targetm.asm.out.reloc_rw_mask): New. * target-def.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_OUT): Use it. * targhooks.c, targhooks.h (default_reloc_rw_mask): New. * varasm.c (categorize_decl_for_section): Remove shlib argument; use the new reloc_rw_mask target hook instead. (default_section_type_flags_1): Merge into... (default_section_type_flags): ... here. (decl_readonly_section_1): Merge into... (decl_readonly_section): ... here. (default_elf_select_section_1): Merge into... (default_elf_select_section): ... here. (default_unique_section_1): Merge into... (default_unique_section): ... here. (compute_reloc_for_rtx_1, compute_reloc_for_rtx): New. (default_select_rtx_section): Use it. (default_elf_select_rtx_section): Likewise. * output.h: Update to match. * doc/tm.texi (TARGET_ASM_RELOC_RW_MASK): New. * config/alpha/alpha.c (alpha_elf_reloc_rw_mask): New. (TARGET_ASM_RELOC_RW_MASK): New. * config/i386/i386.c (x86_64_elf_select_section): Adjust call to categorize_decl_for_section. (x86_64_elf_unique_section): Likewise. * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Remove. (TARGET_ASM_RELOC_RW_MASK): New. * config/ia64/ia64.c (ia64_rwreloc_select_section, ia64_rwreloc_unique_section, ia64_rwreloc_select_rtx_section): Remove. (ia64_hpux_reloc_rw_mask, ia64_reloc_rw_mask): New. (TARGET_RWRELOC): Remove. (ia64_section_type_flags): Adjust call to default_section_type_flags. * config/ia64/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Remove. (rs6000_elf_select_section, rs6000_elf_unique_section): Remove. (rs6000_elf_reloc_rw_mask, rs6000_xcoff_reloc_rw_mask): New. (rs6000_xcoff_select_section): Use decl_readonly_section. (rs6000_xcoff_section_type_flags): Use default_section_type_flags. * config/rs6000/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): Remove. (TARGET_SECTION_TYPE_FLAGS): Remove. * config/rs6000/xcoff.h (TARGET_ASM_RELOC_RW_MASK): New. From-SVN: r122781
2007-03-10 01:53:09 +01:00
static int ia64_hpux_reloc_rw_mask (void) ATTRIBUTE_UNUSED;
static int ia64_reloc_rw_mask (void) ATTRIBUTE_UNUSED;
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
static section *ia64_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
static void ia64_output_dwarf_dtprel (FILE *, int, rtx)
ATTRIBUTE_UNUSED;
static unsigned int ia64_section_type_flags (tree, const char *, int);
static void ia64_init_libfuncs (void)
ATTRIBUTE_UNUSED;
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
static void ia64_hpux_init_libfuncs (void)
ATTRIBUTE_UNUSED;
static void ia64_sysv4_init_libfuncs (void)
ATTRIBUTE_UNUSED;
static void ia64_vms_init_libfuncs (void)
ATTRIBUTE_UNUSED;
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
static void ia64_soft_fp_init_libfuncs (void)
ATTRIBUTE_UNUSED;
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
static bool ia64_vms_valid_pointer_mode (enum machine_mode mode)
ATTRIBUTE_UNUSED;
static tree ia64_vms_common_object_attribute (tree *, tree, tree, int, bool *)
ATTRIBUTE_UNUSED;
config.gcc (with_cpu handling): Translate sparc64 in $machine to --with-cpu=v9. * config.gcc (with_cpu handling): Translate sparc64 in $machine to --with-cpu=v9. * config/alpha/alpha.c (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition. (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK. * target.h: New hook asm_out.file_end. * target.h: Update to match. New hook macro TARGET_ASM_FILE_END. * toplev.c (compile_file: Use targetm.asm_out.file_end. * system.h: Poison ASM_FILE_END. * varasm.c (file_end_indicate_exec_stack): New. * output.h: Prototype it. * doc/tm.texi: Document TARGET_ASM_FILE_END and file_end_indicate_exec_stack. Delete references to attasm.h. * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end. (ASM_FILE_END): Delete; move code... * config/darwin.c (darwin_file_end): Here; new function. * config/darwin-protos.h: Prototype it. * config/alpha/alpha.c (unicosmk_asm_file_end): Make static, rename unicosmk_file_end. * config/arm/aof.h (ASM_FILE_END): Delete; move code... * config/arm/arm.c (aof_file_end): ... here; new static function. Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER. Make aof_dump_imports and aof_dump_pic_table static. * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static. Set TARGET_ASM_FILE_END to avr_file_end. * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments. Set TARGET_ASM_FILE_END to c4x_file_end. * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end, make static. Take no arguments. Set TARGET_ASM_FILE_END to h8300_file_end. * config/i370/i370.h (ASM_FILE_END): Delete; move code... * config/i370/i370.c (i370_file_end): ... here; new static function. Set TARGET_ASM_FILE_END to i370_file_end. * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end. Take no arguments. Call file_end_indicate_exec_stack if NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END. * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. Define NEED_INDICATE_EXEC_STACK to 0. * config/i386/linux.h, config/i386/linux64.h: Redefine NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END. * config/i386/winnt.c (i386_pe_asm_file_end): Rename to i386_pe_file_end. Take no arguments. Use ix86_file_end. * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to ia64_hpux_file_end, make static. Take no arguments. * config/ip2k/ip2k.c (asm_file_start, asm_file_end, commands_in_prologues, commands_in_epilogues): Delete. (function_epilogue): Update to match. * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end, make static. Take no arguments. (iris6_asm_file_end): Rename iris6_file_end, make static, use mips_file_end, take no arguments. Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as appropriate. * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end, make static, take no arguments. Set TARGET_ASM_FILE_END to mmix_file_end. * config/pa/pa.c (output_deferred_plabels): Make static, take no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels. * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it. (ASM_FILE_END): Delete; move code... * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here; new static function. * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h: Don't set ASM_FILE_END. * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to file_end_indicate_exec_stack; don't set ASM_FILE_END. * config/alpha/unicosmk.h, config/i386/cygming.h * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. * config/arm/arm-protos.h, config/alpha/alpha-protos.h * config/avr/avr-protos.h, config/c4x/c4x-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update. From-SVN: r67591
2003-06-07 19:11:48 +02:00
static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *);
static tree ia64_handle_version_id_attribute (tree *, tree, tree, int, bool *);
static void ia64_encode_section_info (tree, rtx, int);
static rtx ia64_struct_value_rtx (tree, int);
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
static tree ia64_gimplify_va_arg (tree, tree, gimple_seq *, gimple_seq *);
static bool ia64_scalar_mode_supported_p (enum machine_mode mode);
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
static bool ia64_vector_mode_supported_p (enum machine_mode mode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
static bool ia64_cannot_force_const_mem (rtx);
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
static const char *ia64_mangle_type (const_tree);
static const char *ia64_invalid_conversion (const_tree, const_tree);
static const char *ia64_invalid_unary_op (int, const_tree);
static const char *ia64_invalid_binary_op (int, const_tree, const_tree);
static enum machine_mode ia64_c_mode_for_suffix (char);
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
static enum machine_mode ia64_promote_function_mode (const_tree,
enum machine_mode,
int *,
const_tree,
int);
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
/* Table of valid machine attributes. */
static const struct attribute_spec ia64_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
{ "syscall_linkage", 0, 0, false, true, true, NULL },
{ "model", 1, 1, true, false, false, ia64_handle_model_attribute },
#if TARGET_ABI_OPEN_VMS
{ "common_object", 1, 1, true, false, false, ia64_vms_common_object_attribute},
#endif
{ "version_id", 1, 1, true, false, false,
ia64_handle_version_id_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
/* Initialize the GCC target structure. */
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE ia64_attribute_table
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target-def.h (TARGET_INIT_BUILTINS): New macro. (TARGET_EXPAND_BUILTIN): New macro. (TARGET_INITIALIZER): Add them. * builtins.c: Include target.h. (expand_builtin): Use targetm.expand_builtin. (default_init_builtins): New function. (default_expand_builtin): New function. * expr.h (default_init_builtins): Declare. (default_expand_builtin): Declare. * c-common.c (c_common_nodes_and_builtins): Use targetm.init_builtins. * defaults.h (MD_INIT_BUILTINS): Remove. * Makefile.in (builtins.o): Depend on target.h. * config/arm/arm.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/arm/arm.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/c4x/c4x.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (c4x_init_builtins): Make endlink arg a local. (c4x_print_operand): Fix typos in adjust_address usages. * config/c4x/c4x-protos.h (c4x_init_builtins): Update decl. * config/c4x/c4x.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/i386/i386.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (ix86_init_mmx_sse_builtins): New function, was ix86_init_builtins. (ix86_init_builtins): Call new function only if TARGET_MMX. * config/i386/i386-protos.h (ix86_init_mmx_sse_builtins): Declare. * config/i386/i386.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/ia64/ia64.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/ia64/ia64.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * doc/tm.texi: Document these changes. From-SVN: r43888
2001-07-10 08:18:36 +02:00
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS ia64_init_builtins
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN ia64_expand_builtin
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
#undef TARGET_ASM_BYTE_OP
#define TARGET_ASM_BYTE_OP "\tdata1\t"
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\tdata2\t"
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\tdata4\t"
#undef TARGET_ASM_ALIGNED_DI_OP
#define TARGET_ASM_ALIGNED_DI_OP "\tdata8\t"
#undef TARGET_ASM_UNALIGNED_HI_OP
#define TARGET_ASM_UNALIGNED_HI_OP "\tdata2.ua\t"
#undef TARGET_ASM_UNALIGNED_SI_OP
#define TARGET_ASM_UNALIGNED_SI_OP "\tdata4.ua\t"
#undef TARGET_ASM_UNALIGNED_DI_OP
#define TARGET_ASM_UNALIGNED_DI_OP "\tdata8.ua\t"
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER ia64_assemble_integer
Makefile.in (final.o): Depend on target.h. * 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. From-SVN: r43817
2001-07-06 20:40:17 +02:00
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
#undef TARGET_ASM_FUNCTION_END_PROLOGUE
#define TARGET_ASM_FUNCTION_END_PROLOGUE ia64_output_function_end_prologue
Makefile.in (final.o): Depend on target.h. * 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. From-SVN: r43817
2001-07-06 20:40:17 +02:00
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE ia64_output_function_epilogue
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
#undef TARGET_IN_SMALL_DATA_P
#define TARGET_IN_SMALL_DATA_P ia64_in_small_data_p
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#undef TARGET_SCHED_ADJUST_COST_2
#define TARGET_SCHED_ADJUST_COST_2 ia64_adjust_cost_2
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE ia64_issue_rate
#undef TARGET_SCHED_VARIABLE_ISSUE
#define TARGET_SCHED_VARIABLE_ISSUE ia64_variable_issue
#undef TARGET_SCHED_INIT
#define TARGET_SCHED_INIT ia64_sched_init
#undef TARGET_SCHED_FINISH
#define TARGET_SCHED_FINISH ia64_sched_finish
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
#undef TARGET_SCHED_INIT_GLOBAL
#define TARGET_SCHED_INIT_GLOBAL ia64_sched_init_global
#undef TARGET_SCHED_FINISH_GLOBAL
#define TARGET_SCHED_FINISH_GLOBAL ia64_sched_finish_global
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
#undef TARGET_SCHED_REORDER
#define TARGET_SCHED_REORDER ia64_sched_reorder
#undef TARGET_SCHED_REORDER2
#define TARGET_SCHED_REORDER2 ia64_sched_reorder2
#undef TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK
#define TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK ia64_dependencies_evaluation_hook
#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ia64_first_cycle_multipass_dfa_lookahead
#undef TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN
#define TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN ia64_init_dfa_pre_cycle_insn
#undef TARGET_SCHED_DFA_PRE_CYCLE_INSN
#define TARGET_SCHED_DFA_PRE_CYCLE_INSN ia64_dfa_pre_cycle_insn
#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD\
ia64_first_cycle_multipass_dfa_lookahead_guard
#undef TARGET_SCHED_DFA_NEW_CYCLE
#define TARGET_SCHED_DFA_NEW_CYCLE ia64_dfa_new_cycle
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
#undef TARGET_SCHED_H_I_D_EXTENDED
#define TARGET_SCHED_H_I_D_EXTENDED ia64_h_i_d_extended
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#undef TARGET_SCHED_ALLOC_SCHED_CONTEXT
#define TARGET_SCHED_ALLOC_SCHED_CONTEXT ia64_alloc_sched_context
#undef TARGET_SCHED_INIT_SCHED_CONTEXT
#define TARGET_SCHED_INIT_SCHED_CONTEXT ia64_init_sched_context
#undef TARGET_SCHED_SET_SCHED_CONTEXT
#define TARGET_SCHED_SET_SCHED_CONTEXT ia64_set_sched_context
#undef TARGET_SCHED_CLEAR_SCHED_CONTEXT
#define TARGET_SCHED_CLEAR_SCHED_CONTEXT ia64_clear_sched_context
#undef TARGET_SCHED_FREE_SCHED_CONTEXT
#define TARGET_SCHED_FREE_SCHED_CONTEXT ia64_free_sched_context
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
#undef TARGET_SCHED_SET_SCHED_FLAGS
#define TARGET_SCHED_SET_SCHED_FLAGS ia64_set_sched_flags
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#undef TARGET_SCHED_GET_INSN_SPEC_DS
#define TARGET_SCHED_GET_INSN_SPEC_DS ia64_get_insn_spec_ds
#undef TARGET_SCHED_GET_INSN_CHECKED_DS
#define TARGET_SCHED_GET_INSN_CHECKED_DS ia64_get_insn_checked_ds
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
#undef TARGET_SCHED_SPECULATE_INSN
#define TARGET_SCHED_SPECULATE_INSN ia64_speculate_insn
#undef TARGET_SCHED_NEEDS_BLOCK_P
#define TARGET_SCHED_NEEDS_BLOCK_P ia64_needs_block_p
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
#undef TARGET_SCHED_GEN_SPEC_CHECK
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#define TARGET_SCHED_GEN_SPEC_CHECK ia64_gen_spec_check
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC\
ia64_first_cycle_multipass_dfa_lookahead_guard_spec
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#undef TARGET_SCHED_SKIP_RTX_P
#define TARGET_SCHED_SKIP_RTX_P ia64_skip_rtx_p
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
#define TARGET_FUNCTION_OK_FOR_SIBCALL ia64_function_ok_for_sibcall
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES ia64_arg_partial_bytes
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK ia64_output_mi_thunk
target.h (gcc_target.asm_out): Merge output_mi_thunk and output_mi_vcall_thunk into a single hook. gcc/ * target.h (gcc_target.asm_out): Merge output_mi_thunk and output_mi_vcall_thunk into a single hook. Add can_output_mi_thunk. * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Don't conditionalize. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Remove. (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. (TARGET_ASM_OUT): Update. * hooks.c (hook_bool_tree_hwi_hwi_tree_false): New. (hook_bool_tree_hwi_hwi_tree_true): New. (default_can_output_mi_thunk_no_vcall): New. * hooks.h: Declare them. * system.h (ASM_OUTPUT_MI_THUNK): Poison. * config/alpha/alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. (alpha_output_mi_thunk_osf): Add VCALL_OFFSET parameter. * config/arm/arm.c, config/cris/cris.c, config/frv/frv.c, config/i960/i960.c, config/ia64/ia64.c, config/m68k/m68k.c, config/mmix/mmix.c, config/pa/pa.c, config/sparc/sparc.c, config/stormy16/stormy16.c: Similarly. * config/i386/i386.c (x86_output_mi_thunk): Merge vcall_offset code. Handle 64-bit properly. Streamline. (x86_output_mi_vcall_thunk): Remove. (x86_this_parameter): Rename from ia32_this_parameter; handle 64-bit. (x86_can_output_mi_thunk): New. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Remove. (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. (override_options): Don't zap targetm.asm_out.output_mi_vcall_thunk. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Rename from output_mi_thunk; make static; always use function_section. (TARGET_ASM_OUTPUT_MI_THUNK): New. (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. (rs6000_ra_ever_killed): Test no_new_pseudos not targetm.asm_out.output_mi_thunk in conjunction with thunks. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (TARGET_ASM_OUTPUT_MI_THUNK): Remove. * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Don't call xcoffout_declare_function when using rs6000_output_mi_thunk. * config/s390/s390.c (s390_output_mi_thunk): Rename from s390_output_mi_vcall_thunk. (TARGET_ASM_OUTPUT_MI_THUNK): Remove. (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. * config/vax/vax.c (vax_output_mi_thunk): Static; add vcall_offset. (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. * config/vax/vax-protos.h: Update. * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Remove. gcc/cp/ * method.c (use_thunk): Always compute vcall_value; assert that it is not zero. Use can_output_mi_thunk; use output_mi_thunk for vcall thunks as well. From-SVN: r58424
2002-10-23 01:05:28 +02:00
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_const_tree_hwi_hwi_const_tree_true
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
#undef TARGET_ASM_FILE_START
#define TARGET_ASM_FILE_START ia64_file_start
#undef TARGET_ASM_GLOBALIZE_DECL_NAME
#define TARGET_ASM_GLOBALIZE_DECL_NAME ia64_globalize_decl_name
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs
target.h (targetm.address_cost): New. * target.h (targetm.address_cost): New. * target-def.h (TARGET_ADDRESS_COST): New. (TARGET_RTX_COSTS): Uncomment. Oops. * cse.c (address_cost): Use new target hook. (default_address_cost): New. * output.h (default_address_cost): Declare. * hooks.c (hook_int_rtx_0): New. * hooks.h (hook_int_rtx_0): Declare. * loop.c (combine_givs_p): Remove if 0 code. * system.h (ADDRESS_COST): Poison. * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c, config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (TARGET_ADDRESS_COST): Define as hook_int_rtx_0. (ADDRESS_COST): Remove. * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h, config/mips/mips.c, config/mips/mips.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h (foo_address_cost): Make static. (TARGET_ADDRESS_COST): New. (ADDRESS_COST): Remove. * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h, config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h (ADDRESS_COST): Move code ... (foo_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/m32r/m32r.c (m32r_address_cost): Remove. * config/m32r/m32r-protos.h: Update. * config/mmix/mmix.c (mmix_address_cost): Remove. * config/mmix/mmix-protos.h: Update. * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from mn10300_address_cost; move unsig allocation ... (mn10300_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/mn10300/mn10300-protos.h: Update. * config/mn10300/mn10300.h (ADDRESS_COST): Remove. From-SVN: r61988
2003-01-28 19:08:56 +01:00
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
#undef TARGET_UNSPEC_MAY_TRAP_P
#define TARGET_UNSPEC_MAY_TRAP_P ia64_unspec_may_trap_p
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG ia64_reorg
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS ia64_section_type_flags
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
#ifdef HAVE_AS_TLS
#undef TARGET_ASM_OUTPUT_DWARF_DTPREL
#define TARGET_ASM_OUTPUT_DWARF_DTPREL ia64_output_dwarf_dtprel
#endif
expr.c (store_constructor): Use promote_decl_mode. 2009-04-17 Paolo Bonzini <bonzini@gnu.org> * expr.c (store_constructor): Use promote_decl_mode. Remove now write-only variable unsignedp. (expand_expr_real_1): Use promote_decl_mode. * expr.h (promote_function_mode, promote_decl_mode): New. (promote_mode): Remove last argument. * function.c (assign_temp): Drop last argument of promote_mode. (assign_parm_find_data_types): Use promote_function_mode. (assign_parm_setup_reg): Likewise. (expand_function_end): Use promote_function_mode. * calls.c (initialize_argument_information): Use promote_function_mode. (precompute_arguments): Use promote_mode instead of checking if only PROMOTE_FUNCTION_MODE is defined. (expand_call): When making sibcall decisions, use promote_function_mode. Below, remove an if for targetm.calls.promote_function_return and and use promote_function_mode. (emit_library_call_value_1): Use promote_function_mode, fix bug where promote_mode was passed FOR_CALL == 0 for a return value in an assertion. * cfgexpand.c (expand_one_register_var): Use promote_decl_mode. * explow.c (promote_function_mode, promote_decl_mode): New. (promote_mode): Keep only the FOR_CALL == 0 case. * combine.c (setup_incoming_promotion): Remove test of promote_function_args. Use promote_function_mode. * stmt.c (expand_value_return): Use promote_decl_mode. (expand_decl): Use promote_decl_mode. * expr.c (store_constructor): Use promote_decl_mode. Remove now write-only variable unsignedp. (expand_expr_real_1): Use promote_decl_mode. * expr.h (promote_function_mode, promote_decl_mode): New. (promote_mode): Remove last argument. * function.c (assign_temp): Drop last argument of promote_mode. (assign_parm_find_data_types): Use promote_function_mode. (assign_parm_setup_reg): Likewise. (expand_function_end): Use promote_function_mode. * calls.c (initialize_argument_information): Use promote_function_mode. (precompute_arguments): Use promote_mode instead of checking if only PROMOTE_FUNCTION_MODE is defined. (expand_call): When making sibcall decisions, use promote_function_mode. Below, remove an if for targetm.calls.promote_function_return and and use promote_function_mode. (emit_library_call_value_1): Use promote_function_mode, fix bug where promote_mode was passed FOR_CALL == 0 for a return value in an assertion. * cfgexpand.c (expand_one_register_var): Use promote_decl_mode. * explow.c (promote_function_mode, promote_decl_mode): New. (promote_mode): Keep only the FOR_CALL == 0 case. * combine.c (setup_incoming_promotion): Remove test of promote_function_args. Use promote_function_mode. * stmt.c (expand_value_return): Use promote_decl_mode. (expand_decl): Use promote_decl_mode. * explow.c (promote_function_mode): Just call the target hook. * targhooks.c (default_promote_function_mode, default_promote_function_mode_always_promote): New. * targhooks.h (default_promote_function_mode, default_promote_function_mode_always_promote): Declare. * target.h (promote_function_args, promote_function_return): Remove. (promote_function_mode): New. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. (TARGET_PROMOTE_FUNCTION_MODE): New. (TARGET_CALLS): Adjust. * system.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, PROMOTE_FUNCTION_MODE): Poison. * config/s390/s390.h (PROMOTE_FUNCTION_MODE): Move... * config/s390/s390.c (s390_promote_function_mode): ... here, with pointer handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/sparc/sparc.h (PROMOTE_FUNCTION_MODE): Move... * config/sparc/sparc.c (sparc_promote_function_mode): ... here, with pointer handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/sh/sh-protos.h (sh_promote_function_mode): New. * config/sh/sh.c (sh_promote_function_mode): New. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/cris/cris.h (PROMOTE_FUNCTION_MODE): Move... * config/cris/cris.c (cris_promote_function_mode): ... here. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS): Remove. * config/mmix/mmix.h (PROMOTE_FUNCTION_MODE): Move... * config/mmix/mmix.c (mmix_promote_function_mode): ... here. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS): Remove. * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Move... * config/arm/arm.c (arm_promote_function_mode): ... here, without complex type handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/pa/pa.c (pa_promote_function_mode): New. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/alpha/alpha.c (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. (TARGET_PROMOTE_FUNCTION_MODE): Define equivalently. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/picochip/picochip.c: Likewise. * config/arc/arc.c: Likewise. * config/mcore/mcore.c: Likewise. * config/score/score.c: Likewise. * config/mips/mips.c: Likewise. * config/bfin/bfin.c: Likewise. * config/ia64/ia64.c: Likewise (disabled though). * config/frv/frv.h: Remove pointless remark. * doc/tm.texi (PROMOTE_FUNCTION_MODE, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Consolidate into... (TARGET_PROMOTE_FUNCTION_MODE): ... this. From-SVN: r150336
2009-08-02 00:03:34 +02:00
#undef TARGET_PROMOTE_FUNCTION_MODE
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
#define TARGET_PROMOTE_FUNCTION_MODE ia64_promote_function_mode
/* ??? Investigate. */
#if 0
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
#endif
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX ia64_struct_value_rtx
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ia64_return_in_memory
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS ia64_setup_incoming_varargs
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target.h (struct gcc_target): Add calls.must_pass_in_stack. * expr.h (MUST_PASS_IN_STACK): Remove. * system.h (MUST_PASS_IN_STACK): Poison. * tree.h (must_pass_in_stack_var_size): Declare. (must_pass_in_stack_var_size_or_pad): Declare. * calls.c (must_pass_in_stack_var_size): New. (must_pass_in_stack_var_size_or_pad): Rename from default_must_pass_in_stack. * config/alpha/alpha.c (unicosmk_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/alpha/unicosmk.h (MUST_PASS_IN_STACK): Remove. * config/fr30/fr30.c (fr30_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/fr30/fr30.h (MUST_PASS_IN_STACK): Remove. * config/frv/frv.c (frv_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/frv/frv.h (MUST_PASS_IN_STACK): Remove. * config/i386/i386-protos.h (ix86_must_pass_in_stack): Remove. * config/i386/i386.c (TARGET_MUST_PASS_IN_STACK): New. (ix86_must_pass_in_stack): Make static. * config/i386/i386.h (MUST_PASS_IN_STACK): Remove. * config/ia64/ia64.c (TARGET_MUST_PASS_IN_STACK): New. * config/ia64/ia64.h (MUST_PASS_IN_STACK): Remove. * config/m32r/m32r.c (TARGET_MUST_PASS_IN_STACK): New. * config/m32r/m32r.h (MUST_PASS_IN_STACK): Remove. * config/mcore/mcore-protos.h (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.c (TARGET_MUST_PASS_IN_STACK): New. (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.h (MUST_PASS_IN_STACK): Remove. * config/mips/mips.c (TARGET_MUST_PASS_IN_STACK): New. * config/mips/mips.h (MUST_PASS_IN_STACK): Remove. * config/pa/pa.c (TARGET_MUST_PASS_IN_STACK): New. * config/pa/pa.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/aix.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/linux64.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/rs6000.c (rs6000_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.c (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.h (MUST_PASS_IN_STACK): Remove. * config/sparc/sparc.c (TARGET_MUST_PASS_IN_STACK): New. * config/sparc/sparc.h (MUST_PASS_IN_STACK): Remove. * config/xtensa/xtensa.c (TARGET_MUST_PASS_IN_STACK): New. * config/xtensa/xtensa.h (MUST_PASS_IN_STACK): Remove. * doc/tm.texi (TARGET_MUST_PASS_IN_STACK): Update from MUST_PASS_IN_STACK. * calls.c, function.c, config/alpha/alpha.c, config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.c, config/cris/cris.h, config/fr30/fr30.c, config/fr30/fr30.h, config/frv/frv.c, config/i386/i386.c, config/iq2000/iq2000.c, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/xtensa/xtensa.c: Use target hook. From-SVN: r84606
2004-07-13 09:45:09 +02:00
#undef TARGET_MUST_PASS_IN_STACK
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ia64_gimplify_va_arg
#undef TARGET_UNWIND_EMIT
#define TARGET_UNWIND_EMIT process_for_unwind_directive
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P ia64_scalar_mode_supported_p
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P ia64_vector_mode_supported_p
Add memory barriers to the double-checked locking used for static initialization. libstdc++: Add memory barriers to the double-checked locking used for static initialization. * libsupc++/guard.cc (__test_and_acquire): Define default. (_GLIBCXX_GUARD_TEST_AND_ACQUIRE, __set_and_release) (_GLIBCXX_GUARD_SET_AND_RELEASE): Likewise. (recursion_push, recursion_pop): New abstraction functions. (__cxa_guard_acquire): Use _GLIBCXX_GUARD_TEST_AND_ACQUIRE. (__cxa_guard_release): Use _GLIBCXX_GUARD_SET_AND_RELEASE. * config/cpu/generic/cxxabi_tweaks.h (_GLIBCXX_GUARD_TEST): Rename from _GLIBCXX_GUARD_ACQUIRE and reverse sense. (_GLIBCXX_GUARD_SET): Rename from _GLIBCXX_GUARD_RELEASE. * config/cpu/arm/cxxabi_tweaks.h: Likewise. * config/cpu/alpha/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER) (_GLIBCXX_WRITE_MEM_BARRIER): Define. * config/cpu/powerpc/atomic_word.h: Likewise. * config/cpu/sparc/atomic_word.h: Likewise. * config/cpu/generic/atomic_word.h: Define them, commented out. * include/bits/atomicity.h: Define defaults. * config/cpu/ia64/atomic_word.h (__test_and_acquire) (__set_and_release): New inlines. (_GLIBCXX_GUARD_TEST_AND_ACQUIRE): Define. (_GLIBCXX_GUARD_SET_AND_RELEASE): Define. * libsupc++/guard.cc (acquire_1): Use __builtin_trap instead of abort(); gcc: * doc/tm.texi (TARGET_RELAXED_ORDERING): Document. * target.h (struct gcc_target): Add relaxed_ordering field. * target-def.h (TARGET_RELAXED_ORDERING): Define default. (TARGET_INITIALIZER): Add it. * config/alpha/alpha.c (TARGET_RELAXED_ORDERING): Define. * config/ia64/ia64.c (TARGET_RELAXED_ORDERING): Define. * config/rs6000/rs6000.c (TARGET_RELAXED_ORDERING): Define. * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Define. * cp/decl.c (expand_static_init): Don't use shortcut if targetm.relaxed_ordering. From-SVN: r92659
2004-12-28 05:36:54 +01:00
/* ia64 architecture manual 4.4.7: ... reads, writes, and flushes may occur
in an order different from the specified program order. */
#undef TARGET_RELAXED_ORDERING
#define TARGET_RELAXED_ORDERING true
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION ia64_handle_option
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM ia64_cannot_force_const_mem
alpha.c (alpha_mangle_fundamental_type): Rename to... gcc/ * config/alpha/alpha.c (alpha_mangle_fundamental_type): Rename to... (alpha_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/arm/arm-protos.h (arm_mangle_type): Add prototype. * config/arm/arm.c (TARGET_MANGLE_TYPE): Define target hook. (arm_init_neon_builtins): Fix comment. (arm_mangle_map_entry): New. (arm_mangle_map): New. (arm_mangle_type): New. * config/i386/i386.c (ix86_mangle_fundamental_type): Rename to... (ix86_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/ia64/ia64.c (ia64_mangle_fundamental_type): Rename to... (ia64_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/rs6000/rs6000.c (rs6000_mangle_fundamental_type): Rename to... (rs6000_mangle_type): This. Use TYPE_MAIN_VARIANT. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/s390/s390.c (s390_mangle_fundamental_type): Rename to... (s390_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/sparc/sparc.c (sparc_mangle_fundamental_type): Rename to... (sparc_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * cp/mangle.c (write_type): Call mangle_type target hook on all types before mangling. Use original type, not main variant, as argument. * target-def.h (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename hook to... (TARGET_MANGLE_TYPE): This. * target.h (gcc_target): Rename mangle_fundamental_type to mangle_type. * doc/tm.texi (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename section to... (TARGET_MANGLE_TYPE): This. Note slightly different semantics. Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com> From-SVN: r126917
2007-07-25 17:43:04 +02:00
#undef TARGET_MANGLE_TYPE
#define TARGET_MANGLE_TYPE ia64_mangle_type
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
#undef TARGET_INVALID_CONVERSION
#define TARGET_INVALID_CONVERSION ia64_invalid_conversion
#undef TARGET_INVALID_UNARY_OP
#define TARGET_INVALID_UNARY_OP ia64_invalid_unary_op
#undef TARGET_INVALID_BINARY_OP
#define TARGET_INVALID_BINARY_OP ia64_invalid_binary_op
#undef TARGET_C_MODE_FOR_SUFFIX
#define TARGET_C_MODE_FOR_SUFFIX ia64_c_mode_for_suffix
hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.c (hook_bool_const_int_const_int_true): New function. * target.h (struct gcc_target): Add can_eliminate field. * target-def.h (TARGET_CAN_ELIMINATE): Define. (TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE. * ira.c (setup_eliminable_regset): Use can_eliminate target hook. * reload1.c (update_eliminables, init_elim_table): (Ditto.). (elim_table): Revise comment. * system.h (CAN_ELIMINATE): Poison. * defaults.h (CAN_ELIMINATE): Remove. * doc/tm.texi (CAN_ELIMINATE): Revise documentation. * config/alpha/vms.h (CAN_ELIMINATE): Remove macro. * config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]: Define macro. (alpha_vms_can_eliminate): Declare as static, change return type to bool. * config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove. * config/arm/arm.h (CAN_ELIMINATE): Remove macro. * config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro. (arm_can_eliminate): New function. * config/avr/avr.h (CAN_ELIMINATE): Remove macro. * config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro. (avr_can_eliminate): Declare as static. * config/avr/avr-protos.h (avr_can_eliminate): Remove. * config/bfin/bfin.h (CAN_ELIMINATE): Remove macro. * config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro. (bfin_can_eliminate): New function. * config/crx/crx.h (CAN_ELIMINATE): Remove macro. * config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro. (crx_can_eliminate): New function. * config/fr30/fr30.h (CAN_ELIMINATE): Remove macro. * config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro. (fr30_can_eliminate): New function. * config/frv/frv.h (CAN_ELIMINATE): Remove macro. * config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro. (frv_can_eliminate): New function. * config/h8300/h8300.h (CAN_ELIMINATE): Remove macro. * config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro. (h8300_can_eliminate): New function. * config/i386/i386.h (CAN_ELIMINATE): Remove macro. * config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro. (i386_can_eliminate): Declare as static, change return type to bool. * config/i386/i386-protos.h (i386_can_eliminate): Remove. * config/ia64/ia64.h (CAN_ELIMINATE): Remove macro. * config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro. (ia64_can_eliminate): New function. * config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro. * config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro. (iq2000_can_eliminate): New function. * config/m32r/m32r.h (CAN_ELIMINATE): Remove macro. * config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro. (m32r_can_eliminate): New function. * config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro. * config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro. (m68hc11_can_eliminate): New function. * config/m68k/m68k.h (CAN_ELIMINATE): Remove macro. * config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro. (m68k_can_eliminate): New function. * config/mep/mep.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro. (mep_can_eliminate): New function. * config/mips/mips.h (CAN_ELIMINATE): Remove macro. * config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro. (mips_can_eliminate): New function. * config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro. * config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro. (rs6000_can_eliminate): New function. * config/s390/s390.h (CAN_ELIMINATE): Remove macro. * config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro. (s390_can_eliminate): Declare as static. * config/s390/s390-protos.h (sparc_can_eliminate): Remove. * config/score/score.h (CAN_ELIMINATE): Remove macro. * config/score/score.c (TARGET_CAN_ELIMINATE): Define macro. (score_can_eliminate): New function. * config/sparc/sparc.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro. (sparc_can_eliminate): Declare as static. * config/sparc/sparc-protos.h (sparc_can_eliminate): Remove. * config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro. * config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro. (xstormy16_can_eliminate): New function. * config/v850/v850.h (CAN_ELIMINATE): Remove macro. * config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro. (v850_can_eliminate): New function. From-SVN: r151096
2009-08-25 23:09:00 +02:00
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE ia64_can_eliminate
struct gcc_target targetm = TARGET_INITIALIZER;
typedef enum
{
ADDR_AREA_NORMAL, /* normal address area */
ADDR_AREA_SMALL /* addressable by "addl" (-2MB < addr < 2MB) */
}
ia64_addr_area;
static GTY(()) tree small_ident1;
static GTY(()) tree small_ident2;
static void
init_idents (void)
{
if (small_ident1 == 0)
{
small_ident1 = get_identifier ("small");
small_ident2 = get_identifier ("__small__");
}
}
/* Retrieve the address area that has been chosen for the given decl. */
static ia64_addr_area
ia64_get_addr_area (tree decl)
{
tree model_attr;
model_attr = lookup_attribute ("model", DECL_ATTRIBUTES (decl));
if (model_attr)
{
tree id;
init_idents ();
id = TREE_VALUE (TREE_VALUE (model_attr));
if (id == small_ident1 || id == small_ident2)
return ADDR_AREA_SMALL;
}
return ADDR_AREA_NORMAL;
}
static tree
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
ia64_handle_model_attribute (tree *node, tree name, tree args,
int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
ia64_addr_area addr_area = ADDR_AREA_NORMAL;
ia64_addr_area area;
tree arg, decl = *node;
init_idents ();
arg = TREE_VALUE (args);
if (arg == small_ident1 || arg == small_ident2)
{
addr_area = ADDR_AREA_SMALL;
}
else
{
arc.c (arc_handle_interrupt_attribute): Use %qE for identifiers in diagnostics. * config/arc/arc.c (arc_handle_interrupt_attribute): Use %qE for identifiers in diagnostics. * config/arm/arm.c (arm_handle_fndecl_attribute, arm_handle_isr_attribute): Likewise. * config/avr/avr.c (avr_handle_progmem_attribute, avr_handle_fndecl_attribute, avr_handle_fntype_attribute): Likewise. * config/bfin/bfin.c (handle_int_attribute, bfin_handle_longcall_attribute, bfin_handle_l1_text_attribute, bfin_handle_l1_data_attribute, bfin_handle_longcall_attribute, bfin_handle_l1_text_attribute, bfin_handle_l1_data_attribute): Likewise. * config/darwin.c (darwin_handle_kext_attribute, darwin_handle_weak_import_attribute): Likewise. * config/h8300/h8300.c (h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): Likewise. * config/i386/i386.c (ix86_handle_cconv_attribute, ix86_handle_abi_attribute, ix86_handle_struct_attribute): Likewise. * config/i386/winnt.c (ix86_handle_shared_attribute, ix86_handle_selectany_attribute): Likewise. * config/ia64/ia64.c (ia64_handle_model_attribute): Likewise. * config/m32c/m32c.c (function_vector_handler): Likewise. * config/m68hc11/m68hc11.c (m68hc11_handle_page0_attribute, m68hc11_handle_fntype_attribute): Likewise. * config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise. * config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise. * config/mips/mips.c (mips_insert_attributes, mips_merge_decl_attributes, mips_expand_builtin): Likewise. * config/rs6000/rs6000.c (rs6000_handle_longcall_attribute, rs6000_handle_struct_attribute): Likewise. * config/sh/sh.c (sh_insert_attributes, sh_handle_resbank_handler_attribute, sh_handle_interrupt_handler_attribute, sh2a_handle_function_vector_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Likewise. * config/sh/symbian.c (sh_symbian_mark_dllimport): Likewise. * config/spu/spu.c (spu_handle_fndecl_attribute, spu_handle_vector_attribute): Likewise. * config/stormy16/stormy16.c (xstormy16_handle_interrupt_attribute): Likewise. * config/v850/v850-c.c (ghs_pragma_section): Likewise. * config/v850/v850.c (v850_handle_interrupt_attribute): Likewise. From-SVN: r147334
2009-05-10 12:29:35 +02:00
warning (OPT_Wattributes, "invalid argument of %qE attribute",
name);
*no_add_attrs = true;
}
switch (TREE_CODE (decl))
{
case VAR_DECL:
if ((DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl))
== FUNCTION_DECL)
&& !TREE_STATIC (decl))
{
error_at (DECL_SOURCE_LOCATION (decl),
"an address area attribute cannot be specified for "
"local variables");
*no_add_attrs = true;
}
area = ia64_get_addr_area (decl);
if (area != ADDR_AREA_NORMAL && addr_area != area)
{
toplev.c (default_tree_printer): Handle setting location with '+' flag. 2005-07-02 Zack Weinberg <zack@codesourcery.com> Joseph S. Myers <joseph@codesourcery.com> * toplev.c (default_tree_printer): Handle setting location with '+' flag. * c-objc.common.c (c_tree_printer): Likewise. * c-format.c (gcc_diag_flag_specs): Add '+'. (gcc_cdiag_char_table): Allow '+' flag for tree formats. (format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag formats. * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c, config/v850/v850.c, function.c, stor-layout.c, toplev.c, tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end of diagnostics. Use %q+D not %s for a decl. Do not pass excess format arguments where %J is used without %D. cp: * error.c (location_of): Add comment. (locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. * cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. * call.c, class.c, decl.c, decl2.c, friend.c, init.c, name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c, typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at or cp_pedwarn_at. Mark up some diagnostic strings with N_. java: * class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q' flag for quoting. objc: * objc-act.c: Use '+' flag instead of %J. Use 'q' flag for quoting. testsuite: * gcc.dg/format/gcc_diag-1.c: Update. From-SVN: r101532
2005-07-02 12:55:32 +02:00
error ("address area of %q+D conflicts with previous "
"declaration", decl);
*no_add_attrs = true;
}
break;
case FUNCTION_DECL:
error_at (DECL_SOURCE_LOCATION (decl),
"address area attribute cannot be specified for "
"functions");
*no_add_attrs = true;
break;
default:
arc.c (arc_handle_interrupt_attribute): Use %qE for identifiers in diagnostics. * config/arc/arc.c (arc_handle_interrupt_attribute): Use %qE for identifiers in diagnostics. * config/arm/arm.c (arm_handle_fndecl_attribute, arm_handle_isr_attribute): Likewise. * config/avr/avr.c (avr_handle_progmem_attribute, avr_handle_fndecl_attribute, avr_handle_fntype_attribute): Likewise. * config/bfin/bfin.c (handle_int_attribute, bfin_handle_longcall_attribute, bfin_handle_l1_text_attribute, bfin_handle_l1_data_attribute, bfin_handle_longcall_attribute, bfin_handle_l1_text_attribute, bfin_handle_l1_data_attribute): Likewise. * config/darwin.c (darwin_handle_kext_attribute, darwin_handle_weak_import_attribute): Likewise. * config/h8300/h8300.c (h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): Likewise. * config/i386/i386.c (ix86_handle_cconv_attribute, ix86_handle_abi_attribute, ix86_handle_struct_attribute): Likewise. * config/i386/winnt.c (ix86_handle_shared_attribute, ix86_handle_selectany_attribute): Likewise. * config/ia64/ia64.c (ia64_handle_model_attribute): Likewise. * config/m32c/m32c.c (function_vector_handler): Likewise. * config/m68hc11/m68hc11.c (m68hc11_handle_page0_attribute, m68hc11_handle_fntype_attribute): Likewise. * config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise. * config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise. * config/mips/mips.c (mips_insert_attributes, mips_merge_decl_attributes, mips_expand_builtin): Likewise. * config/rs6000/rs6000.c (rs6000_handle_longcall_attribute, rs6000_handle_struct_attribute): Likewise. * config/sh/sh.c (sh_insert_attributes, sh_handle_resbank_handler_attribute, sh_handle_interrupt_handler_attribute, sh2a_handle_function_vector_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Likewise. * config/sh/symbian.c (sh_symbian_mark_dllimport): Likewise. * config/spu/spu.c (spu_handle_fndecl_attribute, spu_handle_vector_attribute): Likewise. * config/stormy16/stormy16.c (xstormy16_handle_interrupt_attribute): Likewise. * config/v850/v850-c.c (ghs_pragma_section): Likewise. * config/v850/v850.c (v850_handle_interrupt_attribute): Likewise. From-SVN: r147334
2009-05-10 12:29:35 +02:00
warning (OPT_Wattributes, "%qE attribute ignored",
name);
*no_add_attrs = true;
break;
}
return NULL_TREE;
}
/* The section must have global and overlaid attributes. */
#define SECTION_VMS_OVERLAY SECTION_MACH_DEP
/* Part of the low level implementation of DEC Ada pragma Common_Object which
enables the shared use of variables stored in overlaid linker areas
corresponding to the use of Fortran COMMON. */
static tree
ia64_vms_common_object_attribute (tree *node, tree name, tree args,
int flags ATTRIBUTE_UNUSED,
bool *no_add_attrs)
{
tree decl = *node;
tree id, val;
if (! DECL_P (decl))
abort ();
DECL_COMMON (decl) = 1;
id = TREE_VALUE (args);
if (TREE_CODE (id) == IDENTIFIER_NODE)
val = build_string (IDENTIFIER_LENGTH (id), IDENTIFIER_POINTER (id));
else if (TREE_CODE (id) == STRING_CST)
val = id;
else
{
warning (OPT_Wattributes,
"%qE attribute requires a string constant argument", name);
*no_add_attrs = true;
return NULL_TREE;
}
DECL_SECTION_NAME (decl) = val;
return NULL_TREE;
}
/* Part of the low level implementation of DEC Ada pragma Common_Object. */
void
ia64_vms_output_aligned_decl_common (FILE *file, tree decl, const char *name,
unsigned HOST_WIDE_INT size,
unsigned int align)
{
tree attr = DECL_ATTRIBUTES (decl);
/* As common_object attribute set DECL_SECTION_NAME check it before
looking up the attribute. */
if (DECL_SECTION_NAME (decl) && attr)
attr = lookup_attribute ("common_object", attr);
else
attr = NULL_TREE;
if (!attr)
{
/* Code from elfos.h. */
fprintf (file, "%s", COMMON_ASM_OP);
assemble_name (file, name);
fprintf (file, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",
size, align / BITS_PER_UNIT);
}
else
{
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
ASM_OUTPUT_LABEL (file, name);
ASM_OUTPUT_SKIP (file, size ? size : 1);
}
}
/* Definition of TARGET_ASM_NAMED_SECTION for VMS. */
void
ia64_vms_elf_asm_named_section (const char *name, unsigned int flags,
tree decl)
{
if (!(flags & SECTION_VMS_OVERLAY))
{
default_elf_asm_named_section (name, flags, decl);
return;
}
if (flags != (SECTION_VMS_OVERLAY | SECTION_WRITE))
abort ();
if (flags & SECTION_DECLARED)
{
fprintf (asm_out_file, "\t.section\t%s\n", name);
return;
}
fprintf (asm_out_file, "\t.section\t%s,\"awgO\"\n", name);
}
static void
ia64_encode_addr_area (tree decl, rtx symbol)
{
int flags;
flags = SYMBOL_REF_FLAGS (symbol);
switch (ia64_get_addr_area (decl))
{
case ADDR_AREA_NORMAL: break;
case ADDR_AREA_SMALL: flags |= SYMBOL_FLAG_SMALL_ADDR; break;
default: gcc_unreachable ();
}
SYMBOL_REF_FLAGS (symbol) = flags;
}
static void
ia64_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
/* Careful not to prod global register variables. */
if (TREE_CODE (decl) == VAR_DECL
&& GET_CODE (DECL_RTL (decl)) == MEM
&& GET_CODE (XEXP (DECL_RTL (decl), 0)) == SYMBOL_REF
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
ia64_encode_addr_area (decl, XEXP (rtl, 0));
}
/* Return 1 if the operands of a move are ok. */
int
ia64_move_ok (rtx dst, rtx src)
{
/* If we're under init_recog_no_volatile, we'll not be able to use
memory_operand. So check the code directly and don't worry about
the validity of the underlying address, which should have been
checked elsewhere anyway. */
if (GET_CODE (dst) != MEM)
return 1;
if (GET_CODE (src) == MEM)
return 0;
if (register_operand (src, VOIDmode))
return 1;
/* Otherwise, this must be a constant, and that either 0 or 0.0 or 1.0. */
if (INTEGRAL_MODE_P (GET_MODE (dst)))
return src == const0_rtx;
else
return satisfies_constraint_G (src);
}
/* Return 1 if the operands are ok for a floating point load pair. */
int
ia64_load_pair_ok (rtx dst, rtx src)
{
if (GET_CODE (dst) != REG || !FP_REGNO_P (REGNO (dst)))
return 0;
if (GET_CODE (src) != MEM || MEM_VOLATILE_P (src))
return 0;
switch (GET_CODE (XEXP (src, 0)))
{
case REG:
case POST_INC:
break;
case POST_DEC:
return 0;
case POST_MODIFY:
{
rtx adjust = XEXP (XEXP (XEXP (src, 0), 1), 1);
if (GET_CODE (adjust) != CONST_INT
|| INTVAL (adjust) != GET_MODE_SIZE (GET_MODE (src)))
return 0;
}
break;
default:
abort ();
}
return 1;
}
int
addp4_optimize_ok (rtx op1, rtx op2)
{
return (basereg_operand (op1, GET_MODE(op1)) !=
basereg_operand (op2, GET_MODE(op2)));
}
/* Check if OP is a mask suitable for use with SHIFT in a dep.z instruction.
Return the length of the field, or <= 0 on failure. */
int
ia64_depz_field_mask (rtx rop, rtx rshift)
{
unsigned HOST_WIDE_INT op = INTVAL (rop);
unsigned HOST_WIDE_INT shift = INTVAL (rshift);
/* Get rid of the zero bits we're shifting in. */
op >>= shift;
/* We must now have a solid block of 1's at bit 0. */
return exact_log2 (op + 1);
}
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
/* Return the TLS model to use for ADDR. */
static enum tls_model
tls_symbolic_operand_type (rtx addr)
{
collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. ./: * collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. * dce.c (run_fast_df_dce): Change type of old_flags to int. * df-core.c (df_set_flags): Change return type to int. Change type of old_flags to int. (df_clear_flags): Likewise. * df-scan.c (df_def_record_1): Change 0 to VOIDmode. (df_get_conditional_uses): Likewise. * df.h (df_set_flags, df_clear_flags): Update declarations. * dwarf2out.c (struct indirect_string_node): Change type of form field to enum dwarf_form. (AT_string_form): Change return type to enum dwarf_form. * fixed-value.c (fixed_compare): Add cast to enum type. * fwprop.c (update_df): Change 0 to VOIDmode. * gensupport.c: Change 0 to UNKNOWN. * gimple.h (gimple_cond_code): Add cast to enum type. * haifa-sched.c (reemit_notes): Add cast to enum type. * hooks.c (hook_int_void_no_regs): Remove function. * hooks.h (hook_int_void_no_regs): Remove declaration. * optabs.c (expand_widen_pattern_expr): Change 0 to VOIDmode. * predict.c (combine_predictions_for_insn): Add casts to enum type. * real.c (real_arithmetic): Add cast to enum type. (real_compare): Likewise. * target.h (struct gcc_target): Change return type of branch_target_register_class to enum reg_class. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define as default_branch_target_register_class. * targhooks.c (default_branch_target_register_class): New function. * targhooks.h (default_branch_target_register_class): Declare. * tree-data-ref.c (print_direction_vector): Add cast to enum type. * tree-vect-data-refs.c (vect_supportable_dr_alignment): Remove cast to int. * tree-vect-loop.c (vect_create_epilog_for_reduction): Change 0 to ERROR_MARK. * tree-vect-slp.c (vect_build_slp_tree): Change 0 to vect_uninitialized_def. Change 0 to ERROR_MARK. * tree-vect-stmts.c (supportable_widening_operation): Don't initialize icode1 and icode2. * tree-vectorizer.h (enum vect_def_type): Add vect_uninitialized_def. * config/sol2-c.c (cmn_err_length_specs): Change 0 to FMT_LEN_none and to STD_C89. (cmn_err_flag_specs): Change 0 to STD_C89. (cmn_err_char_table): Likewise. * config/arm/arm.c (get_arm_condition_code): Change type of code to enum arm_cond_code. (IWMMXT_BUILTIN): Change 0 to UNKNOWN. (IWMMXT_BUILTIN2): Likewise. (neon_builtin_type_bits): Don't define typedef. (neon_builtin_datum): Change type of bits field to int. (arm_expand_neon_args): Add cast to enum type. * config/ia64/ia64.c (tls_symbolic_operand_type): Change 0 to TLS_MODEL_NONE. * config/i386/i386.c (bdesc_multi_arg): Change 0 to UNKNOWN. Add casts to enum type. * config/mips/mips.c (LOONGSON_BUILTIN_ALIAS): Change 0 to MIPS_FP_COND_f. * config/mips/mips.md (jal_macro): Return enum constant. (single_insn): Likewise. * config/rs6000/rs6000.c (bdesc_altivec_preds): Change 0 to CODE_FOR_nothing. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add casts to enum type. * config/s390/s390.c (s390_tune_flags): Change type to int. (s390_arch_flags): Likewise. (s390_handle_arch_option): Change flags field of struct pta to int. * config/s390/s390.h (s390_tune_flags): Update declaration. (s390_arch_flags): Likewise. * config/sh/sh.c (prepare_move_operands): Compare tls_symbolic_operand result with enum constant. (sh_reorg): Change PUT_MODE to PUT_REG_NOTE_KIND. (sh_expand_prologue): Add cast to enum type. (sh_expand_epilogue): Likewise. (tls_symbolic_operand): Change return type to enum tls_model. (fpscr_set_from_mem): Add cast to enum type. (legitimize_pic_address): Compare tls_symbolic_operand result with enum constant. (sh_target_reg_class): Change return type to enum reg_class. * config/sh/sh.h (OVERRIDE_OPTIONS): Change CPU_xxx to PROCESSOR_xxx. * config/sh/sh-protos.h (tls_symbolic_operand): Update declaration. * config/sparc/sparc.c (sparc_override_options): Add cast to enum type. * config/sparc/sparc.md (empty_delay_slot): Return enum constant. (pic, calls_alloca, calls_eh_return, leaf_function): Likewise. (delayed_branch, tls_call_delay): Likewise. (eligible_for_sibcall_delay): Likewise. (eligible_for_return_delay): Likewise. * config/spu/spu.c (expand_builtin_args): Add cast to enum type. (spu_expand_builtin_1): Likewise. * c-typeck.c (convert_for_assignment): Issue -Wc++-compat warnings for all types of conversions. (output_init_element): Issue -Wc++-compat warning if needed when initializing a bitfield with enum type. * c-parser.c (c_parser_expression): Set original_type to original_type of right hand operand of comman operator. cp/: * semantics.c (finish_omp_clauses): Change type of c_kind to enum omp_clause_code. fortran/: * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum type. * trans-io.c (st_parameter_field): Add casts to enum type. java/: * builtins.c (java_builtins): Add casts to enum type. * verify-impl.c (check_class_constant): Add cast to enum type. (check_constant, check_wide_constant): Likewise. objc/: * objc-act.c (objc_gimplify_expr): Add casts to enum type. testsuite/: * gcc.dg/Wcxx-compat-5.c: New testcase. * gcc.dg/Wcxx-compat-6.c: New testcase. From-SVN: r146855
2009-04-27 22:25:48 +02:00
enum tls_model tls_kind = TLS_MODEL_NONE;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (GET_CODE (addr) == CONST)
{
if (GET_CODE (XEXP (addr, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF)
tls_kind = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (addr, 0), 0));
}
else if (GET_CODE (addr) == SYMBOL_REF)
tls_kind = SYMBOL_REF_TLS_MODEL (addr);
return tls_kind;
}
/* Return true if X is a constant that is valid for some immediate
field in an instruction. */
bool
ia64_legitimate_constant_p (rtx x)
{
switch (GET_CODE (x))
{
case CONST_INT:
case LABEL_REF:
return true;
case CONST_DOUBLE:
if (GET_MODE (x) == VOIDmode || GET_MODE (x) == SFmode
|| GET_MODE (x) == DFmode)
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
return true;
return satisfies_constraint_G (x);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
case CONST:
case SYMBOL_REF:
/* ??? Short term workaround for PR 28490. We must make the code here
match the code in ia64_expand_move and move_operand, even though they
are both technically wrong. */
if (tls_symbolic_operand_type (x) == 0)
{
HOST_WIDE_INT addend = 0;
rtx op = x;
if (GET_CODE (op) == CONST
&& GET_CODE (XEXP (op, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
{
addend = INTVAL (XEXP (XEXP (op, 0), 1));
op = XEXP (XEXP (op, 0), 0);
}
if (any_offset_symbol_operand (op, GET_MODE (op))
|| function_operand (op, GET_MODE (op)))
return true;
if (aligned_offset_symbol_operand (op, GET_MODE (op)))
return (addend & 0x3fff) == 0;
return false;
}
return false;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
case CONST_VECTOR:
{
enum machine_mode mode = GET_MODE (x);
if (mode == V2SFmode)
return satisfies_constraint_Y (x);
return (GET_MODE_CLASS (mode) == MODE_VECTOR_INT
&& GET_MODE_SIZE (mode) <= 8);
}
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
default:
return false;
}
}
/* Don't allow TLS addresses to get spilled to memory. */
static bool
ia64_cannot_force_const_mem (rtx x)
{
if (GET_MODE (x) == RFmode)
return true;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
return tls_symbolic_operand_type (x) != 0;
}
/* Expand a symbolic constant load. */
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
bool
ia64_expand_load_address (rtx dest, rtx src)
{
gcc_assert (GET_CODE (dest) == REG);
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
/* ILP32 mode still loads 64-bits of data from the GOT. This avoids
having to pointer-extend the value afterward. Other forms of address
computation below are also more natural to compute as 64-bit quantities.
If we've been given an SImode destination register, change it. */
if (GET_MODE (dest) != Pmode)
rtl.def (SUBREG): Update comments. gcc/ * rtl.def (SUBREG): Update comments. * rtl.h (reg_attrs): Be explicit about the type of offset used. (set_reg_attrs_from_mem): Rename to... (set_reg_attrs_from_value): ...this. (adjust_reg_mode, byte_lowpart_offset): Declare. * emit-rtl.c (byte_lowpart_offset): New function. (update_reg_offset): Remove special offset handling for big-endian targets. (gen_rtx_REG_offset, gen_reg_rtx_offset): Explicitly say that the offset parameter is added to REG_OFFSET. (adjust_reg_mode): New function. (set_reg_attrs_for_mem): Rename to... (set_reg_attrs_for_value): ...this and generalize to all values. If the register is a lowpart of the value, adjust the offset accordingly. (set_reg_attrs_for_parm): Update after the above renaming. (set_reg_attrs_for_decl_rtl): New function, split out from set_decl_incoming_rtl. Set the offset of plain REGs to the offset of the REG's mode from the decl's. Assert that all subregs are lowparts and handle their inner registers in the same way as plain REGs. (set_decl_rtl, set_incoming_decl_rtl): Use reg_attrs_for_decl_rtl. (subreg_lowpart_offset): Explicitly say that the returned offset is a SUBREG_BYTE. * combine.c (do_SUBST_MODE, try_combine, undo_all): Use adjust_reg_mode instead of PUT_MODE. * final.c (alter_subreg): Fix/update argument to gen_rtx_REG_offset. * config/ia64/ia64.c (ia64_expand_load_address): Likewise. * regclass.c (reg_scan_mark_refs): Use set_reg_attrs_from_value. * reload.c (find_reloads_subreg_address): Call set_mem_offset when offseting a MEM. * var-tracking.c (offset_valid_for_tracked_p): Delete. (mode_for_reg_attrs): Replace with... (track_loc_p): ...this new function. Return the mode and offset to the caller, checking that the latter is valid. If the rtx is a paradoxical lowpart of the decl, use the decl's mode instead. Do the same when storing to a register that contains the entire decl. (var_lowpart): Use byte_lowpart_offset rather than subreg_lowpart_offset when adjusting the offset attribute. (count_uses, add_uses, add_stores): Use track_reg_p instead of REG_EXPR, MEM_EXPR, REG_OFFSET, INT_MEM_OFFSET, track_expr_p, offset_valid_for_tracked_p and mode_for_reg_attrs. Generate lowparts for MEMs as well as REGs. (vt_add_function_parameters): When obtaining the information from the decl_rtl, adjust the offset to match incoming. Use track_loc_p and var_lowpart. From-SVN: r131055
2007-12-19 10:54:24 +01:00
dest = gen_rtx_REG_offset (dest, Pmode, REGNO (dest),
byte_lowpart_offset (Pmode, GET_MODE (dest)));
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (TARGET_NO_PIC)
return false;
if (small_addr_symbolic_operand (src, VOIDmode))
return false;
if (TARGET_AUTO_PIC)
emit_insn (gen_load_gprel64 (dest, src));
else if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (src))
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_load_fptr (dest, src));
else if (sdata_symbolic_operand (src, VOIDmode))
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_load_gprel (dest, src));
else
{
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
HOST_WIDE_INT addend = 0;
rtx tmp;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
/* We did split constant offsets in ia64_expand_move, and we did try
to keep them split in move_operand, but we also allowed reload to
rematerialize arbitrary constants rather than spill the value to
the stack and reload it. So we have to be prepared here to split
them apart again. */
if (GET_CODE (src) == CONST)
{
HOST_WIDE_INT hi, lo;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
hi = INTVAL (XEXP (XEXP (src, 0), 1));
lo = ((hi & 0x3fff) ^ 0x2000) - 0x2000;
hi = hi - lo;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (lo != 0)
{
addend = lo;
src = plus_constant (XEXP (XEXP (src, 0), 0), hi);
}
}
tmp = gen_rtx_HIGH (Pmode, src);
tmp = gen_rtx_PLUS (Pmode, tmp, pic_offset_table_rtx);
emit_insn (gen_rtx_SET (VOIDmode, dest, tmp));
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
tmp = gen_rtx_LO_SUM (Pmode, dest, src);
emit_insn (gen_rtx_SET (VOIDmode, dest, tmp));
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (addend)
{
tmp = gen_rtx_PLUS (Pmode, dest, GEN_INT (addend));
emit_insn (gen_rtx_SET (VOIDmode, dest, tmp));
}
}
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
return true;
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static GTY(()) rtx gen_tls_tga;
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
static rtx
gen_tls_get_addr (void)
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
{
if (!gen_tls_tga)
gen_tls_tga = init_one_libfunc ("__tls_get_addr");
return gen_tls_tga;
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
}
static GTY(()) rtx thread_pointer_rtx;
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
static rtx
gen_thread_pointer (void)
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
{
if (!thread_pointer_rtx)
rtl.h (MEM_READONLY_P): Replace RTX_UNCHANGING_P. * rtl.h (MEM_READONLY_P): Replace RTX_UNCHANGING_P. * alias.c (true_dependence): Update to match new semantics. (canon_true_dependence, write_dependence_p): Likewise. (anti_dependence, output_dependence): Update write_dependence_p args. (unchanging_anti_dependence): Remove. * calls.c (purge_mem_unchanging_flag): Remove. (fixup_tail_calls): Don't call it. (expand_call): Don't add unchanging memory to function usage. * expr.c (emit_block_move_via_libcall): Likewise. (clear_storage_via_libcall): Don't clobber RTX_UNCHANGING_P mems. (get_subtarget): Don't use RTX_UNCHANGING_P. (expand_assignment, store_constructor, expand_expr_real_1): Likewise. (do_tablejump): Set MEM_READONLY_P, not RTX_UNCHANGING_P. * combine.c (get_last_value_validate): Use MEM_READONLY_P. * cse.c (insert): Don't use RTX_UNCHANGING_P. (cse_insn, canon_hash): Use MEM_READONLY_P. * emit-rtl.c (set_mem_attributes_minus_bitpos): Use MEM_READONLY_P instead of RTX_UNCHANGING_P. * explow.c (maybe_set_unchanging): Remove. * expr.h (maybe_set_unchanging): Remove. * flow.c (insn_dead_p, mark_used_regs): Use anti_dependence. * function.c (assign_stack_temp_for_type): Don't use RTX_UNCHANGING_P. (assign_parm_setup_reg, expand_function_start): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. * ra-rewrite.c (emit_colors): Likewise. * regmove.c (copy_src_to_dest, regmove_optimize): Likewise. (fixup_match_1): Likewise. * reload1.c (reload, alter_reg): Likewise. * local-alloc.c (validate_equiv_mem): Check MEM_READONLY_P, not RTX_UNCHANGING_P. (equiv_init_varies_p): Likewise. * loop-invariant.c (check_maybe_invariant): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * loop.c (note_addr_stored): Likewise. (prescan_loop): Likewise. Don't check function usage for clobbered unchanging memory. * rtlanal.c (rtx_unstable_p): Check MEM_READONLY_P, not RTX_UNCHANGING_P. (rtx_varies_p, modified_between_p, modified_in_p): Likewise. * varasm.c (force_const_mem): Likewise. * stmt.c (expand_decl): Don't set RTX_UNCHANGING_P. * web.c (entry_register): Likewise. * tree-gimple.h (get_base_address): Move decl ... * tree.h: ... here. * doc/rtl.texi (MEM_READONLY_P): Replace RTX_UNCHANGING_P. * config/alpha/alpha.c (alpha_set_memflags_1): Rewrite to be called via for_each_rtx. Copy MEM_SCALAR_P, MEM_NOTRAP_P too. (alpha_set_memflags): Update to match. * config/darwin.c (machopic_indirect_data_reference): Set MEM_READONLY_P instead of RTX_UNCHANGING_P. (machopic_indirect_call_target): Likewise. (machopic_legitimize_pic_address): Likewise. * config/arm/arm.c (legitimize_pic_address, arm_gen_load_multiple, arm_gen_store_multiple, arm_gen_movmemqi): Likewise. * config/arm/arm.md (load_multiple, store_multiple): Likewise. * config/frv/frv.md (symGOT2reg): Likewise. * config/i386/i386.c (legitimize_pic_address, legitimize_tls_address, ix86_split_to_parts): Likewise. * config/ia64/ia64.c (ia64_expand_tls_address): Likewise. * config/ia64/ia64.md (load_fptr): Likewise. * config/m32r/m32r.c (m32r_legitimize_pic_address): Likewise. * config/m68k/m68k.c (legitimize_pic_address): Likewise. * config/mcore/mcore.c (block_move_sequence): Likewise. * config/mn10300/mn10300.md (symGOT2reg): Likewise. * config/pa/pa.c (legitimize_pic_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise. (rs6000_emit_move): Likewise. * config/s390/s390.c (legitimize_pic_address): Likewise. (legitimize_tls_address): Likewise. * config/s390/s390.md (casesi): Likewise. * config/sh/sh.c (prepare_move_operands, sh_reorg): Likewise. * config/sh/sh.md (symGOT2reg): Likewise. * config/sparc/sparc.c (legitimize_pic_address): Likewise. * config/v850/v850.md (casesi): Likewise. * config/ia64/ia64.c (gen_thread_pointer): Don't set RTX_UNCHANGING_P. * config/iq2000/iq2000.c (save_restore_insns): Likewise. * config/mips/mips.c (mips_restore_gp): Likewise. (mips_save_restore_reg, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_reorg): Likewise. From-SVN: r86178
2004-08-18 10:25:01 +02:00
thread_pointer_rtx = gen_rtx_REG (Pmode, 13);
return thread_pointer_rtx;
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
}
static rtx
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1,
rtx orig_op1, HOST_WIDE_INT addend)
{
rtx tga_op1, tga_op2, tga_ret, tga_eqv, tmp, insns;
rtx orig_op0 = op0;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
HOST_WIDE_INT addend_lo, addend_hi;
switch (tls_kind)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
start_sequence ();
tga_op1 = gen_reg_rtx (Pmode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_load_dtpmod (tga_op1, op1));
tga_op2 = gen_reg_rtx (Pmode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_load_dtprel (tga_op2, op1));
tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX,
LCT_CONST, Pmode, 2, tga_op1,
Pmode, tga_op2, Pmode);
insns = get_insns ();
end_sequence ();
if (GET_MODE (op0) != Pmode)
op0 = tga_ret;
emit_libcall_block (insns, op0, tga_ret, op1);
break;
case TLS_MODEL_LOCAL_DYNAMIC:
/* ??? This isn't the completely proper way to do local-dynamic
If the call to __tls_get_addr is used only by a single symbol,
then we should (somehow) move the dtprel to the second arg
to avoid the extra add. */
start_sequence ();
tga_op1 = gen_reg_rtx (Pmode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_load_dtpmod (tga_op1, op1));
tga_op2 = const0_rtx;
tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX,
LCT_CONST, Pmode, 2, tga_op1,
Pmode, tga_op2, Pmode);
insns = get_insns ();
end_sequence ();
tga_eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
UNSPEC_LD_BASE);
tmp = gen_reg_rtx (Pmode);
emit_libcall_block (insns, tmp, tga_ret, tga_eqv);
if (!register_operand (op0, Pmode))
op0 = gen_reg_rtx (Pmode);
if (TARGET_TLS64)
{
emit_insn (gen_load_dtprel (op0, op1));
emit_insn (gen_adddi3 (op0, tmp, op0));
}
else
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_add_dtprel (op0, op1, tmp));
break;
case TLS_MODEL_INITIAL_EXEC:
addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000;
addend_hi = addend - addend_lo;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
op1 = plus_constant (op1, addend_hi);
addend = addend_lo;
tmp = gen_reg_rtx (Pmode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_load_tprel (tmp, op1));
if (!register_operand (op0, Pmode))
op0 = gen_reg_rtx (Pmode);
emit_insn (gen_adddi3 (op0, tmp, gen_thread_pointer ()));
break;
case TLS_MODEL_LOCAL_EXEC:
if (!register_operand (op0, Pmode))
op0 = gen_reg_rtx (Pmode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
op1 = orig_op1;
addend = 0;
if (TARGET_TLS64)
{
emit_insn (gen_load_tprel (op0, op1));
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_adddi3 (op0, op0, gen_thread_pointer ()));
}
else
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_add_tprel (op0, op1, gen_thread_pointer ()));
break;
default:
gcc_unreachable ();
}
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (addend)
op0 = expand_simple_binop (Pmode, PLUS, op0, GEN_INT (addend),
orig_op0, 1, OPTAB_DIRECT);
if (orig_op0 == op0)
return NULL_RTX;
if (GET_MODE (orig_op0) == Pmode)
return op0;
return gen_lowpart (GET_MODE (orig_op0), op0);
}
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
rtx
ia64_expand_move (rtx op0, rtx op1)
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
{
enum machine_mode mode = GET_MODE (op0);
if (!reload_in_progress && !reload_completed && !ia64_move_ok (op0, op1))
op1 = force_reg (mode, op1);
if ((mode == Pmode || mode == ptr_mode) && symbolic_operand (op1, VOIDmode))
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
{
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
HOST_WIDE_INT addend = 0;
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
enum tls_model tls_kind;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
rtx sym = op1;
if (GET_CODE (op1) == CONST
&& GET_CODE (XEXP (op1, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (op1, 0), 1)) == CONST_INT)
{
addend = INTVAL (XEXP (XEXP (op1, 0), 1));
sym = XEXP (XEXP (op1, 0), 0);
}
tls_kind = tls_symbolic_operand_type (sym);
if (tls_kind)
return ia64_expand_tls_address (tls_kind, op0, sym, op1, addend);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (any_offset_symbol_operand (sym, mode))
addend = 0;
else if (aligned_offset_symbol_operand (sym, mode))
{
HOST_WIDE_INT addend_lo, addend_hi;
addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000;
addend_hi = addend - addend_lo;
if (addend_lo != 0)
{
op1 = plus_constant (sym, addend_hi);
addend = addend_lo;
}
else
addend = 0;
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
}
else
op1 = sym;
if (reload_completed)
{
/* We really should have taken care of this offset earlier. */
gcc_assert (addend == 0);
if (ia64_expand_load_address (op0, op1))
return NULL_RTX;
}
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
if (addend)
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
{
Replace no_new_pseudos in backends. * rtl.h (can_create_pseudo_p): Define. * config/darwin.c (machopic_indirect_data_reference): Use can_create_pseudo_p () instead of no_new_pseudos. (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/alpha/alpha.c (alpha_legitimize_address): Likewise. (alpha_emit_set_const_1): Likewise. (alpha_emit_set_const): Likewise. (alpha_emit_conditional_move): Likewise. (alpha_split_conditional_move): Likewise. * config/alpha/alpha.md (various splitters): Likewise. (movti): Likewise. * config/arm/arm.c (legitimize_pic_address): Likewise. (arm_load_pic_register): Likewise. * config/arm/arm.md (addsi3, subsi3, andsi3, iorsi3): Likewise. (movdi, movsi, movhi, movqi, movsf, movdf): Likewise. * config/bfin/bfin.c (legitimize_pic_address): Likewise. * config/cris/cris.c (cris_expand_pic_call_address): Likewise. * config/cris/cris.md (movsi): Likewise. * config/frv/frv.md (symGOT2reg_hilo): Likewise. (symGOTOFF2reg_hilo): Likewise. (symGPREL2reg, symGPREL2reg_hilo): Likewise. * config/h8300/h8300.md (insv, extzv): Likewise. * config/i386/i386.c (ix86_expand_move): Likewise. (ix86_expand_vector_move): Likewise. (ix86_prepare_fp_compare_args): Likewise. (ix86_expand_carry_flag_compare): Likewise. * config/i386/i386.md (tls_dynamic_gnu2_32): Likewise. (tls_dynamic_gnu2_combine_32): Likewise. (tls_dynamic_gnu2_64, tls_dynamic_gnu2_combine_64): Likewise. * config/ia64/ia64.c (ia64_expand_move): Likewise. (ia64_expand_movxf_movrf): Likewise. * config/m32c/m32c.c (m32c_prepare_move): Likewise. (m32c_split_move): Likewise. (m32c_expand_insv): Likewise. * config/m68k/m68k.md (movsi): Likewise. * config/mips/mips.c (mips_force_temporary): Likewise. (mips_split_symbol): Likewise. (mips_move_integer): Likewise. (mips_legitimize_const_move): Likewise. * config/mn10300/mn10300.md (movsi): Likewise. * config/pa/pa.c (emit_move_sequence): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. (rs6000_got_register): Likewise. (create_TOC_reference): Likewise. (rs6000_machopic_legitimize_pic_address): Likewise. * config/rs6000/rs6000.md (add<mode>3): Likewise. (various splitters): Likewise. (iorsi3, xorsi3, iordi3, xordi3): Likewise. (movsi_got): Likewise. * config/s390/s390.c (emit_symbolic_move): Likewise. * config/s390/s390.md (movhi, movqi): Likewise. (load_multiple, store_multiple): Likewise. * config/score/score.c (score_force_temporary): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (prepare_cbranch_operands): Likewise. (emit_fpu_switch): Likewise. (fpscr_set_from_mem): Likewise. * config/sh/sh.md (movdicc, movsicc, movsicc_umin): Likewise. (adddi3, subsi3): Likewise. (various splitters): Likewise. (divsi_inv_fp_combine): Likewise. (symGOT_load, symGOTOFF2reg, symDTPOFF2reg): Likewise. (seq, slt, sle, sgt, sge, sgtu, sltu, sleu, sgeu): Likewise. (sne): Likewise. * config/sh/predicates.md (xor_operand): Likewise. * config/sparc/sparc.c (legitimize_tls_address): Likewise. * config/sparc/sparc.md (movsi_pic_label_ref): Likewise. (movdi_pic_label_ref): Likewise. * config/spu/spu.c (spu_split_immediate): Likewise. * config/alpha/alpha.md (various splitters): Remove test !no_new_pseudos || reload_completed. * config/ia64/ia64.c (ia64_output_mi_thunk): Don't set no_new_pseudos. * config/m68k/m68k.c (m68k_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (th_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. From-SVN: r126517
2007-07-10 19:23:11 +02:00
rtx subtarget = !can_create_pseudo_p () ? op0 : gen_reg_rtx (mode);
re PR target/21412 (ICE loading TLS address) PR target/21412 * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. (ia64_cannot_force_const_mem): New. (tls_symbolic_operand_type): New. (ia64_legitimate_constant_p): New. (ia64_expand_load_address): Return true on success. Improve checks for when we should not split. (ia64_expand_tls_address): New addend operand. Distribute it as appropriate to the tls_kind. Delay referencing gp. (ia64_expand_move): Split symbolic addend as necessary. Handle tls symbols with addends. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, p0, f0, f1, and r13. (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. * config/ia64/ia64.md (UNSPEC_DTPMOD): New. (symbolic_operand splitter): Pass everything through ia64_expand_load_address and FAIL or DONE as appropriate. (load_fptr): Only accept after reload. (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, load_symptr_low, load_ltoff_dtpmod, (load_dtpmod): New. (load_dtprel): Only accept tls symbols. (load_dtprel64, load_dtprel22): Likewise. (load_tprel, load_tprel64, load_tprel22): Likewise. (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. (add_dtprel): Only accept tls symbols. Canonicalize PLUS. (add_dtprel14, add_dtprel22): Likewise. (add_tprel, add_tprel14, add_tprel22): Likewise. * config/ia64/predicates.md (small_addr_symbolic_operand): New. (any_offset_symbol_operand, aligned_offset_symbol_operand): New. (got_symbolic_operand): Check CONST offsets. (tls_symbolic_operand, ld_tls_symbolic_operand): New. (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. (move_operand): Don't handle tls here. Check CONST offsets. From-SVN: r99596
2005-05-11 23:34:19 +02:00
emit_insn (gen_rtx_SET (VOIDmode, subtarget, op1));
op1 = expand_simple_binop (mode, PLUS, subtarget,
GEN_INT (addend), op0, 1, OPTAB_DIRECT);
if (op0 == op1)
return NULL_RTX;
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
}
}
return op1;
}
/* Split a move from OP1 to OP0 conditional on COND. */
void
ia64_emit_cond_move (rtx op0, rtx op1, rtx cond)
{
rtx insn, first = get_last_insn ();
emit_move_insn (op0, op1);
for (insn = get_last_insn (); insn != first; insn = PREV_INSN (insn))
if (INSN_P (insn))
PATTERN (insn) = gen_rtx_COND_EXEC (VOIDmode, copy_rtx (cond),
PATTERN (insn));
}
/* Split a post-reload TImode or TFmode reference into two DImode
components. This is made extra difficult by the fact that we do
not get any scratch registers to work with, because reload cannot
be prevented from giving us a scratch that overlaps the register
pair involved. So instead, when addressing memory, we tweak the
pointer register up and back down with POST_INCs. Or up and not
back down when we can get away with it.
REVERSED is true when the loads must be done in reversed order
(high word first) for correctness. DEAD is true when the pointer
dies with the second insn we generate and therefore the second
address must not carry a postmodify.
May return an insn which is to be emitted after the moves. */
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
static rtx
ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead)
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
{
rtx fixup = 0;
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
switch (GET_CODE (in))
{
case REG:
out[reversed] = gen_rtx_REG (DImode, REGNO (in));
out[!reversed] = gen_rtx_REG (DImode, REGNO (in) + 1);
break;
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
case CONST_INT:
case CONST_DOUBLE:
/* Cannot occur reversed. */
gcc_assert (!reversed);
if (GET_MODE (in) != TFmode)
split_double (in, &out[0], &out[1]);
else
/* split_double does not understand how to split a TFmode
quantity into a pair of DImode constants. */
{
REAL_VALUE_TYPE r;
unsigned HOST_WIDE_INT p[2];
long l[4]; /* TFmode is 128 bits */
REAL_VALUE_FROM_CONST_DOUBLE (r, in);
real_to_target (l, &r, TFmode);
if (FLOAT_WORDS_BIG_ENDIAN)
{
p[0] = (((unsigned HOST_WIDE_INT) l[0]) << 32) + l[1];
p[1] = (((unsigned HOST_WIDE_INT) l[2]) << 32) + l[3];
}
else
{
p[0] = (((unsigned HOST_WIDE_INT) l[1]) << 32) + l[0];
p[1] = (((unsigned HOST_WIDE_INT) l[3]) << 32) + l[2];
}
out[0] = GEN_INT (p[0]);
out[1] = GEN_INT (p[1]);
}
break;
case MEM:
{
rtx base = XEXP (in, 0);
rtx offset;
switch (GET_CODE (base))
{
case REG:
if (!reversed)
{
out[0] = adjust_automodify_address
(in, DImode, gen_rtx_POST_INC (Pmode, base), 0);
out[1] = adjust_automodify_address
(in, DImode, dead ? 0 : gen_rtx_POST_DEC (Pmode, base), 8);
}
else
{
/* Reversal requires a pre-increment, which can only
be done as a separate insn. */
emit_insn (gen_adddi3 (base, base, GEN_INT (8)));
out[0] = adjust_automodify_address
(in, DImode, gen_rtx_POST_DEC (Pmode, base), 8);
out[1] = adjust_address (in, DImode, 0);
}
break;
case POST_INC:
gcc_assert (!reversed && !dead);
/* Just do the increment in two steps. */
out[0] = adjust_automodify_address (in, DImode, 0, 0);
out[1] = adjust_automodify_address (in, DImode, 0, 8);
break;
case POST_DEC:
gcc_assert (!reversed && !dead);
/* Add 8, subtract 24. */
base = XEXP (base, 0);
out[0] = adjust_automodify_address
(in, DImode, gen_rtx_POST_INC (Pmode, base), 0);
out[1] = adjust_automodify_address
(in, DImode,
gen_rtx_POST_MODIFY (Pmode, base, plus_constant (base, -24)),
8);
break;
case POST_MODIFY:
gcc_assert (!reversed && !dead);
/* Extract and adjust the modification. This case is
trickier than the others, because we might have an
index register, or we might have a combined offset that
doesn't fit a signed 9-bit displacement field. We can
assume the incoming expression is already legitimate. */
offset = XEXP (base, 1);
base = XEXP (base, 0);
out[0] = adjust_automodify_address
(in, DImode, gen_rtx_POST_INC (Pmode, base), 0);
if (GET_CODE (XEXP (offset, 1)) == REG)
{
/* Can't adjust the postmodify to match. Emit the
original, then a separate addition insn. */
out[1] = adjust_automodify_address (in, DImode, 0, 8);
fixup = gen_adddi3 (base, base, GEN_INT (-8));
}
else
{
gcc_assert (GET_CODE (XEXP (offset, 1)) == CONST_INT);
if (INTVAL (XEXP (offset, 1)) < -256 + 8)
{
/* Again the postmodify cannot be made to match,
but in this case it's more efficient to get rid
of the postmodify entirely and fix up with an
add insn. */
out[1] = adjust_automodify_address (in, DImode, base, 8);
fixup = gen_adddi3
(base, base, GEN_INT (INTVAL (XEXP (offset, 1)) - 8));
}
else
{
/* Combined offset still fits in the displacement field.
(We cannot overflow it at the high end.) */
out[1] = adjust_automodify_address
(in, DImode, gen_rtx_POST_MODIFY
(Pmode, base, gen_rtx_PLUS
(Pmode, base,
GEN_INT (INTVAL (XEXP (offset, 1)) - 8))),
8);
}
}
break;
default:
gcc_unreachable ();
}
break;
}
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
default:
gcc_unreachable ();
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
}
return fixup;
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
}
/* Split a TImode or TFmode move instruction after reload.
This is used by *movtf_internal and *movti_internal. */
void
ia64_split_tmode_move (rtx operands[])
{
rtx in[2], out[2], insn;
rtx fixup[2];
bool dead = false;
bool reversed = false;
/* It is possible for reload to decide to overwrite a pointer with
the value it points to. In that case we have to do the loads in
the appropriate order so that the pointer is not destroyed too
early. Also we must not generate a postmodify for that second
load, or rws_access_regno will die. */
if (GET_CODE (operands[1]) == MEM
&& reg_overlap_mentioned_p (operands[0], operands[1]))
{
rtx base = XEXP (operands[1], 0);
while (GET_CODE (base) != REG)
base = XEXP (base, 0);
if (REGNO (base) == REGNO (operands[0]))
reversed = true;
dead = true;
}
/* Another reason to do the moves in reversed order is if the first
element of the target register pair is also the second element of
the source register pair. */
if (GET_CODE (operands[0]) == REG && GET_CODE (operands[1]) == REG
&& REGNO (operands[0]) == REGNO (operands[1]) + 1)
reversed = true;
fixup[0] = ia64_split_tmode (in, operands[1], reversed, dead);
fixup[1] = ia64_split_tmode (out, operands[0], reversed, dead);
#define MAYBE_ADD_REG_INC_NOTE(INSN, EXP) \
if (GET_CODE (EXP) == MEM \
&& (GET_CODE (XEXP (EXP, 0)) == POST_MODIFY \
|| GET_CODE (XEXP (EXP, 0)) == POST_INC \
|| GET_CODE (XEXP (EXP, 0)) == POST_DEC)) \
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (insn, REG_INC, XEXP (XEXP (EXP, 0), 0))
insn = emit_insn (gen_rtx_SET (VOIDmode, out[0], in[0]));
MAYBE_ADD_REG_INC_NOTE (insn, in[0]);
MAYBE_ADD_REG_INC_NOTE (insn, out[0]);
insn = emit_insn (gen_rtx_SET (VOIDmode, out[1], in[1]));
MAYBE_ADD_REG_INC_NOTE (insn, in[1]);
MAYBE_ADD_REG_INC_NOTE (insn, out[1]);
if (fixup[0])
emit_insn (fixup[0]);
if (fixup[1])
emit_insn (fixup[1]);
#undef MAYBE_ADD_REG_INC_NOTE
}
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
/* ??? Fixing GR->FR XFmode moves during reload is hard. You need to go
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
through memory plus an extra GR scratch register. Except that you can
either get the first from SECONDARY_MEMORY_NEEDED or the second from
SECONDARY_RELOAD_CLASS, but not both.
We got into problems in the first place by allowing a construct like
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
(subreg:XF (reg:TI)), which we got from a union containing a long double.
This solution attempts to prevent this situation from occurring. When
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
we see something like the above, we spill the inner register to memory. */
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
static rtx
spill_xfmode_rfmode_operand (rtx in, int force, enum machine_mode mode)
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
{
if (GET_CODE (in) == SUBREG
&& GET_MODE (SUBREG_REG (in)) == TImode
&& GET_CODE (SUBREG_REG (in)) == REG)
{
rtx memt = assign_stack_temp (TImode, 16, 0);
emit_move_insn (memt, SUBREG_REG (in));
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
return adjust_address (memt, mode, 0);
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
}
else if (force && GET_CODE (in) == REG)
{
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
rtx memx = assign_stack_temp (mode, 16, 0);
emit_move_insn (memx, in);
return memx;
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
}
else
return in;
}
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
/* Expand the movxf or movrf pattern (MODE says which) with the given
OPERANDS, returning true if the pattern should then invoke
DONE. */
bool
ia64_expand_movxf_movrf (enum machine_mode mode, rtx operands[])
{
rtx op0 = operands[0];
if (GET_CODE (op0) == SUBREG)
op0 = SUBREG_REG (op0);
/* We must support XFmode loads into general registers for stdarg/vararg,
unprototyped calls, and a rare case where a long double is passed as
an argument after a float HFA fills the FP registers. We split them into
DImode loads for convenience. We also need to support XFmode stores
for the last case. This case does not happen for stdarg/vararg routines,
because we do a block store to memory of unnamed arguments. */
if (GET_CODE (op0) == REG && GR_REGNO_P (REGNO (op0)))
{
rtx out[2];
/* We're hoping to transform everything that deals with XFmode
quantities and GR registers early in the compiler. */
Replace no_new_pseudos in backends. * rtl.h (can_create_pseudo_p): Define. * config/darwin.c (machopic_indirect_data_reference): Use can_create_pseudo_p () instead of no_new_pseudos. (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/alpha/alpha.c (alpha_legitimize_address): Likewise. (alpha_emit_set_const_1): Likewise. (alpha_emit_set_const): Likewise. (alpha_emit_conditional_move): Likewise. (alpha_split_conditional_move): Likewise. * config/alpha/alpha.md (various splitters): Likewise. (movti): Likewise. * config/arm/arm.c (legitimize_pic_address): Likewise. (arm_load_pic_register): Likewise. * config/arm/arm.md (addsi3, subsi3, andsi3, iorsi3): Likewise. (movdi, movsi, movhi, movqi, movsf, movdf): Likewise. * config/bfin/bfin.c (legitimize_pic_address): Likewise. * config/cris/cris.c (cris_expand_pic_call_address): Likewise. * config/cris/cris.md (movsi): Likewise. * config/frv/frv.md (symGOT2reg_hilo): Likewise. (symGOTOFF2reg_hilo): Likewise. (symGPREL2reg, symGPREL2reg_hilo): Likewise. * config/h8300/h8300.md (insv, extzv): Likewise. * config/i386/i386.c (ix86_expand_move): Likewise. (ix86_expand_vector_move): Likewise. (ix86_prepare_fp_compare_args): Likewise. (ix86_expand_carry_flag_compare): Likewise. * config/i386/i386.md (tls_dynamic_gnu2_32): Likewise. (tls_dynamic_gnu2_combine_32): Likewise. (tls_dynamic_gnu2_64, tls_dynamic_gnu2_combine_64): Likewise. * config/ia64/ia64.c (ia64_expand_move): Likewise. (ia64_expand_movxf_movrf): Likewise. * config/m32c/m32c.c (m32c_prepare_move): Likewise. (m32c_split_move): Likewise. (m32c_expand_insv): Likewise. * config/m68k/m68k.md (movsi): Likewise. * config/mips/mips.c (mips_force_temporary): Likewise. (mips_split_symbol): Likewise. (mips_move_integer): Likewise. (mips_legitimize_const_move): Likewise. * config/mn10300/mn10300.md (movsi): Likewise. * config/pa/pa.c (emit_move_sequence): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. (rs6000_got_register): Likewise. (create_TOC_reference): Likewise. (rs6000_machopic_legitimize_pic_address): Likewise. * config/rs6000/rs6000.md (add<mode>3): Likewise. (various splitters): Likewise. (iorsi3, xorsi3, iordi3, xordi3): Likewise. (movsi_got): Likewise. * config/s390/s390.c (emit_symbolic_move): Likewise. * config/s390/s390.md (movhi, movqi): Likewise. (load_multiple, store_multiple): Likewise. * config/score/score.c (score_force_temporary): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (prepare_cbranch_operands): Likewise. (emit_fpu_switch): Likewise. (fpscr_set_from_mem): Likewise. * config/sh/sh.md (movdicc, movsicc, movsicc_umin): Likewise. (adddi3, subsi3): Likewise. (various splitters): Likewise. (divsi_inv_fp_combine): Likewise. (symGOT_load, symGOTOFF2reg, symDTPOFF2reg): Likewise. (seq, slt, sle, sgt, sge, sgtu, sltu, sleu, sgeu): Likewise. (sne): Likewise. * config/sh/predicates.md (xor_operand): Likewise. * config/sparc/sparc.c (legitimize_tls_address): Likewise. * config/sparc/sparc.md (movsi_pic_label_ref): Likewise. (movdi_pic_label_ref): Likewise. * config/spu/spu.c (spu_split_immediate): Likewise. * config/alpha/alpha.md (various splitters): Remove test !no_new_pseudos || reload_completed. * config/ia64/ia64.c (ia64_output_mi_thunk): Don't set no_new_pseudos. * config/m68k/m68k.c (m68k_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (th_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. From-SVN: r126517
2007-07-10 19:23:11 +02:00
gcc_assert (can_create_pseudo_p ());
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
/* Struct to register can just use TImode instead. */
if ((GET_CODE (operands[1]) == SUBREG
&& GET_MODE (SUBREG_REG (operands[1])) == TImode)
|| (GET_CODE (operands[1]) == REG
&& GR_REGNO_P (REGNO (operands[1]))))
{
rtx op1 = operands[1];
if (GET_CODE (op1) == SUBREG)
op1 = SUBREG_REG (op1);
else
op1 = gen_rtx_REG (TImode, REGNO (op1));
emit_move_insn (gen_rtx_REG (TImode, REGNO (op0)), op1);
return true;
}
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
/* Don't word-swap when reading in the constant. */
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
emit_move_insn (gen_rtx_REG (DImode, REGNO (op0)),
operand_subword (operands[1], WORDS_BIG_ENDIAN,
0, mode));
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
emit_move_insn (gen_rtx_REG (DImode, REGNO (op0) + 1),
operand_subword (operands[1], !WORDS_BIG_ENDIAN,
0, mode));
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
return true;
}
/* If the quantity is in a register not known to be GR, spill it. */
if (register_operand (operands[1], mode))
operands[1] = spill_xfmode_rfmode_operand (operands[1], 1, mode);
gcc_assert (GET_CODE (operands[1]) == MEM);
/* Don't word-swap when reading in the value. */
out[0] = gen_rtx_REG (DImode, REGNO (op0));
out[1] = gen_rtx_REG (DImode, REGNO (op0) + 1);
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
emit_move_insn (out[0], adjust_address (operands[1], DImode, 0));
emit_move_insn (out[1], adjust_address (operands[1], DImode, 8));
return true;
}
if (GET_CODE (operands[1]) == REG && GR_REGNO_P (REGNO (operands[1])))
{
/* We're hoping to transform everything that deals with XFmode
quantities and GR registers early in the compiler. */
Replace no_new_pseudos in backends. * rtl.h (can_create_pseudo_p): Define. * config/darwin.c (machopic_indirect_data_reference): Use can_create_pseudo_p () instead of no_new_pseudos. (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/alpha/alpha.c (alpha_legitimize_address): Likewise. (alpha_emit_set_const_1): Likewise. (alpha_emit_set_const): Likewise. (alpha_emit_conditional_move): Likewise. (alpha_split_conditional_move): Likewise. * config/alpha/alpha.md (various splitters): Likewise. (movti): Likewise. * config/arm/arm.c (legitimize_pic_address): Likewise. (arm_load_pic_register): Likewise. * config/arm/arm.md (addsi3, subsi3, andsi3, iorsi3): Likewise. (movdi, movsi, movhi, movqi, movsf, movdf): Likewise. * config/bfin/bfin.c (legitimize_pic_address): Likewise. * config/cris/cris.c (cris_expand_pic_call_address): Likewise. * config/cris/cris.md (movsi): Likewise. * config/frv/frv.md (symGOT2reg_hilo): Likewise. (symGOTOFF2reg_hilo): Likewise. (symGPREL2reg, symGPREL2reg_hilo): Likewise. * config/h8300/h8300.md (insv, extzv): Likewise. * config/i386/i386.c (ix86_expand_move): Likewise. (ix86_expand_vector_move): Likewise. (ix86_prepare_fp_compare_args): Likewise. (ix86_expand_carry_flag_compare): Likewise. * config/i386/i386.md (tls_dynamic_gnu2_32): Likewise. (tls_dynamic_gnu2_combine_32): Likewise. (tls_dynamic_gnu2_64, tls_dynamic_gnu2_combine_64): Likewise. * config/ia64/ia64.c (ia64_expand_move): Likewise. (ia64_expand_movxf_movrf): Likewise. * config/m32c/m32c.c (m32c_prepare_move): Likewise. (m32c_split_move): Likewise. (m32c_expand_insv): Likewise. * config/m68k/m68k.md (movsi): Likewise. * config/mips/mips.c (mips_force_temporary): Likewise. (mips_split_symbol): Likewise. (mips_move_integer): Likewise. (mips_legitimize_const_move): Likewise. * config/mn10300/mn10300.md (movsi): Likewise. * config/pa/pa.c (emit_move_sequence): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. (rs6000_got_register): Likewise. (create_TOC_reference): Likewise. (rs6000_machopic_legitimize_pic_address): Likewise. * config/rs6000/rs6000.md (add<mode>3): Likewise. (various splitters): Likewise. (iorsi3, xorsi3, iordi3, xordi3): Likewise. (movsi_got): Likewise. * config/s390/s390.c (emit_symbolic_move): Likewise. * config/s390/s390.md (movhi, movqi): Likewise. (load_multiple, store_multiple): Likewise. * config/score/score.c (score_force_temporary): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (prepare_cbranch_operands): Likewise. (emit_fpu_switch): Likewise. (fpscr_set_from_mem): Likewise. * config/sh/sh.md (movdicc, movsicc, movsicc_umin): Likewise. (adddi3, subsi3): Likewise. (various splitters): Likewise. (divsi_inv_fp_combine): Likewise. (symGOT_load, symGOTOFF2reg, symDTPOFF2reg): Likewise. (seq, slt, sle, sgt, sge, sgtu, sltu, sleu, sgeu): Likewise. (sne): Likewise. * config/sh/predicates.md (xor_operand): Likewise. * config/sparc/sparc.c (legitimize_tls_address): Likewise. * config/sparc/sparc.md (movsi_pic_label_ref): Likewise. (movdi_pic_label_ref): Likewise. * config/spu/spu.c (spu_split_immediate): Likewise. * config/alpha/alpha.md (various splitters): Remove test !no_new_pseudos || reload_completed. * config/ia64/ia64.c (ia64_output_mi_thunk): Don't set no_new_pseudos. * config/m68k/m68k.c (m68k_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (th_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. From-SVN: r126517
2007-07-10 19:23:11 +02:00
gcc_assert (can_create_pseudo_p ());
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
/* Op0 can't be a GR_REG here, as that case is handled above.
If op0 is a register, then we spill op1, so that we now have a
MEM operand. This requires creating an XFmode subreg of a TImode reg
to force the spill. */
if (register_operand (operands[0], mode))
{
rtx op1 = gen_rtx_REG (TImode, REGNO (operands[1]));
op1 = gen_rtx_SUBREG (mode, op1, 0);
operands[1] = spill_xfmode_rfmode_operand (op1, 0, mode);
}
else
{
rtx in[2];
gcc_assert (GET_CODE (operands[0]) == MEM);
/* Don't word-swap when writing out the value. */
in[0] = gen_rtx_REG (DImode, REGNO (operands[1]));
in[1] = gen_rtx_REG (DImode, REGNO (operands[1]) + 1);
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
emit_move_insn (adjust_address (operands[0], DImode, 0), in[0]);
emit_move_insn (adjust_address (operands[0], DImode, 8), in[1]);
return true;
}
}
if (!reload_in_progress && !reload_completed)
{
operands[1] = spill_xfmode_rfmode_operand (operands[1], 0, mode);
if (GET_MODE (op0) == TImode && GET_CODE (op0) == REG)
{
rtx memt, memx, in = operands[1];
if (CONSTANT_P (in))
in = validize_mem (force_const_mem (mode, in));
if (GET_CODE (in) == MEM)
memt = adjust_address (in, TImode, 0);
else
{
memt = assign_stack_temp (TImode, 16, 0);
memx = adjust_address (memt, mode, 0);
emit_move_insn (memx, in);
}
emit_move_insn (op0, memt);
return true;
}
if (!ia64_move_ok (operands[0], operands[1]))
operands[1] = force_reg (mode, operands[1]);
}
return false;
}
/* Emit comparison instruction if necessary, replacing *EXPR, *OP0, *OP1
with the expression that holds the compare result (in VOIDmode). */
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
static GTY(()) rtx cmptf_libfunc;
void
ia64_expand_compare (rtx *expr, rtx *op0, rtx *op1)
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
{
enum rtx_code code = GET_CODE (*expr);
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
rtx cmp;
/* If we have a BImode input, then we already have a compare result, and
do not need to emit another comparison. */
if (GET_MODE (*op0) == BImode)
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
{
gcc_assert ((code == NE || code == EQ) && *op1 == const0_rtx);
cmp = *op0;
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
}
/* HPUX TFmode compare requires a library call to _U_Qfcmp, which takes a
magic number as its third argument, that indicates what to do.
The return value is an integer to be compared against zero. */
else if (TARGET_HPUX && GET_MODE (*op0) == TFmode)
{
enum qfcmp_magic {
QCMP_INV = 1, /* Raise FP_INVALID on SNaN as a side effect. */
QCMP_UNORD = 2,
QCMP_EQ = 4,
QCMP_LT = 8,
QCMP_GT = 16
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
2009-04-24 17:31:38 +02:00
};
int magic;
enum rtx_code ncode;
rtx ret, insns;
gcc_assert (cmptf_libfunc && GET_MODE (*op1) == TFmode);
switch (code)
{
/* 1 = equal, 0 = not equal. Equality operators do
not raise FP_INVALID when given an SNaN operand. */
case EQ: magic = QCMP_EQ; ncode = NE; break;
case NE: magic = QCMP_EQ; ncode = EQ; break;
/* isunordered() from C99. */
case UNORDERED: magic = QCMP_UNORD; ncode = NE; break;
case ORDERED: magic = QCMP_UNORD; ncode = EQ; break;
/* Relational operators raise FP_INVALID when given
an SNaN operand. */
case LT: magic = QCMP_LT |QCMP_INV; ncode = NE; break;
case LE: magic = QCMP_LT|QCMP_EQ|QCMP_INV; ncode = NE; break;
case GT: magic = QCMP_GT |QCMP_INV; ncode = NE; break;
case GE: magic = QCMP_GT|QCMP_EQ|QCMP_INV; ncode = NE; break;
/* FUTURE: Implement UNEQ, UNLT, UNLE, UNGT, UNGE, LTGT.
Expanders for buneq etc. weuld have to be added to ia64.md
for this to be useful. */
default: gcc_unreachable ();
}
start_sequence ();
ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode, 3,
*op0, TFmode, *op1, TFmode,
GEN_INT (magic), DImode);
cmp = gen_reg_rtx (BImode);
emit_insn (gen_rtx_SET (VOIDmode, cmp,
gen_rtx_fmt_ee (ncode, BImode,
ret, const0_rtx)));
insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, cmp, cmp,
gen_rtx_fmt_ee (code, BImode, *op0, *op1));
code = NE;
}
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
else
{
cmp = gen_reg_rtx (BImode);
emit_insn (gen_rtx_SET (VOIDmode, cmp,
gen_rtx_fmt_ee (code, BImode, *op0, *op1)));
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
code = NE;
}
*expr = gen_rtx_fmt_ee (code, VOIDmode, cmp, const0_rtx);
*op0 = cmp;
*op1 = const0_rtx;
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
}
/* Generate an integral vector comparison. Return true if the condition has
been reversed, and so the sense of the comparison should be inverted. */
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
static bool
ia64_expand_vecint_compare (enum rtx_code code, enum machine_mode mode,
rtx dest, rtx op0, rtx op1)
{
bool negate = false;
rtx x;
/* Canonicalize the comparison to EQ, GT, GTU. */
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
switch (code)
{
case EQ:
case GT:
case GTU:
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
break;
case NE:
case LE:
case LEU:
code = reverse_condition (code);
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
negate = true;
break;
case GE:
case GEU:
code = reverse_condition (code);
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
negate = true;
/* FALLTHRU */
case LT:
case LTU:
code = swap_condition (code);
x = op0, op0 = op1, op1 = x;
break;
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
default:
gcc_unreachable ();
}
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
/* Unsigned parallel compare is not supported by the hardware. Play some
tricks to turn this into a signed comparison against 0. */
if (code == GTU)
{
switch (mode)
{
case V2SImode:
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
{
rtx t1, t2, mask;
/* Perform a parallel modulo subtraction. */
t1 = gen_reg_rtx (V2SImode);
emit_insn (gen_subv2si3 (t1, op0, op1));
/* Extract the original sign bit of op0. */
mask = GEN_INT (-0x80000000);
mask = gen_rtx_CONST_VECTOR (V2SImode, gen_rtvec (2, mask, mask));
mask = force_reg (V2SImode, mask);
t2 = gen_reg_rtx (V2SImode);
emit_insn (gen_andv2si3 (t2, op0, mask));
/* XOR it back into the result of the subtraction. This results
in the sign bit set iff we saw unsigned underflow. */
x = gen_reg_rtx (V2SImode);
emit_insn (gen_xorv2si3 (x, t1, t2));
code = GT;
op0 = x;
op1 = CONST0_RTX (mode);
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
}
break;
case V8QImode:
case V4HImode:
/* Perform a parallel unsigned saturating subtraction. */
x = gen_reg_rtx (mode);
emit_insn (gen_rtx_SET (VOIDmode, x,
gen_rtx_US_MINUS (mode, op0, op1)));
code = EQ;
op0 = x;
op1 = CONST0_RTX (mode);
negate = !negate;
break;
default:
gcc_unreachable ();
}
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
}
x = gen_rtx_fmt_ee (code, mode, op0, op1);
emit_insn (gen_rtx_SET (VOIDmode, dest, x));
return negate;
}
/* Emit an integral vector conditional move. */
void
ia64_expand_vecint_cmov (rtx operands[])
{
enum machine_mode mode = GET_MODE (operands[0]);
enum rtx_code code = GET_CODE (operands[3]);
bool negate;
rtx cmp, x, ot, of;
cmp = gen_reg_rtx (mode);
negate = ia64_expand_vecint_compare (code, mode, cmp,
operands[4], operands[5]);
ot = operands[1+negate];
of = operands[2-negate];
if (ot == CONST0_RTX (mode))
{
if (of == CONST0_RTX (mode))
{
emit_move_insn (operands[0], ot);
return;
}
x = gen_rtx_NOT (mode, cmp);
x = gen_rtx_AND (mode, x, of);
emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
}
else if (of == CONST0_RTX (mode))
{
x = gen_rtx_AND (mode, cmp, ot);
emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
}
else
{
rtx t, f;
t = gen_reg_rtx (mode);
x = gen_rtx_AND (mode, cmp, operands[1+negate]);
emit_insn (gen_rtx_SET (VOIDmode, t, x));
f = gen_reg_rtx (mode);
x = gen_rtx_NOT (mode, cmp);
x = gen_rtx_AND (mode, x, operands[2-negate]);
emit_insn (gen_rtx_SET (VOIDmode, f, x));
x = gen_rtx_IOR (mode, t, f);
emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
}
}
/* Emit an integral vector min or max operation. Return true if all done. */
bool
ia64_expand_vecint_minmax (enum rtx_code code, enum machine_mode mode,
rtx operands[])
{
rtx xops[6];
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
/* These four combinations are supported directly. */
if (mode == V8QImode && (code == UMIN || code == UMAX))
return false;
if (mode == V4HImode && (code == SMIN || code == SMAX))
return false;
/* This combination can be implemented with only saturating subtraction. */
if (mode == V4HImode && code == UMAX)
{
rtx x, tmp = gen_reg_rtx (mode);
x = gen_rtx_US_MINUS (mode, operands[1], operands[2]);
emit_insn (gen_rtx_SET (VOIDmode, tmp, x));
emit_insn (gen_addv4hi3 (operands[0], tmp, operands[2]));
return true;
}
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
/* Everything else implemented via vector comparisons. */
xops[0] = operands[0];
xops[4] = xops[1] = operands[1];
xops[5] = xops[2] = operands[2];
switch (code)
{
case UMIN:
code = LTU;
break;
case UMAX:
code = GTU;
break;
case SMIN:
code = LT;
break;
case SMAX:
code = GT;
break;
default:
gcc_unreachable ();
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
}
xops[3] = gen_rtx_fmt_ee (code, VOIDmode, operands[1], operands[2]);
ia64_expand_vecint_cmov (xops);
return true;
}
/* Emit an integral vector widening sum operations. */
void
ia64_expand_widen_sum (rtx operands[3], bool unsignedp)
{
rtx l, h, x, s;
enum machine_mode wmode, mode;
rtx (*unpack_l) (rtx, rtx, rtx);
rtx (*unpack_h) (rtx, rtx, rtx);
rtx (*plus) (rtx, rtx, rtx);
wmode = GET_MODE (operands[0]);
mode = GET_MODE (operands[1]);
switch (mode)
{
case V8QImode:
unpack_l = gen_unpack1_l;
unpack_h = gen_unpack1_h;
plus = gen_addv4hi3;
break;
case V4HImode:
unpack_l = gen_unpack2_l;
unpack_h = gen_unpack2_h;
plus = gen_addv2si3;
break;
default:
gcc_unreachable ();
}
/* Fill in x with the sign extension of each element in op1. */
if (unsignedp)
x = CONST0_RTX (mode);
else
{
bool neg;
x = gen_reg_rtx (mode);
neg = ia64_expand_vecint_compare (LT, mode, x, operands[1],
CONST0_RTX (mode));
gcc_assert (!neg);
}
l = gen_reg_rtx (wmode);
h = gen_reg_rtx (wmode);
s = gen_reg_rtx (wmode);
emit_insn (unpack_l (gen_lowpart (mode, l), operands[1], x));
emit_insn (unpack_h (gen_lowpart (mode, h), operands[1], x));
emit_insn (plus (s, l, operands[2]));
emit_insn (plus (operands[0], h, s));
}
/* Emit a signed or unsigned V8QI dot product operation. */
void
ia64_expand_dot_prod_v8qi (rtx operands[4], bool unsignedp)
{
rtx l1, l2, h1, h2, x1, x2, p1, p2, p3, p4, s1, s2, s3;
/* Fill in x1 and x2 with the sign extension of each element. */
if (unsignedp)
x1 = x2 = CONST0_RTX (V8QImode);
else
{
bool neg;
x1 = gen_reg_rtx (V8QImode);
x2 = gen_reg_rtx (V8QImode);
neg = ia64_expand_vecint_compare (LT, V8QImode, x1, operands[1],
CONST0_RTX (V8QImode));
gcc_assert (!neg);
neg = ia64_expand_vecint_compare (LT, V8QImode, x2, operands[2],
CONST0_RTX (V8QImode));
gcc_assert (!neg);
}
l1 = gen_reg_rtx (V4HImode);
l2 = gen_reg_rtx (V4HImode);
h1 = gen_reg_rtx (V4HImode);
h2 = gen_reg_rtx (V4HImode);
emit_insn (gen_unpack1_l (gen_lowpart (V8QImode, l1), operands[1], x1));
emit_insn (gen_unpack1_l (gen_lowpart (V8QImode, l2), operands[2], x2));
emit_insn (gen_unpack1_h (gen_lowpart (V8QImode, h1), operands[1], x1));
emit_insn (gen_unpack1_h (gen_lowpart (V8QImode, h2), operands[2], x2));
p1 = gen_reg_rtx (V2SImode);
p2 = gen_reg_rtx (V2SImode);
p3 = gen_reg_rtx (V2SImode);
p4 = gen_reg_rtx (V2SImode);
emit_insn (gen_pmpy2_r (p1, l1, l2));
emit_insn (gen_pmpy2_l (p2, l1, l2));
emit_insn (gen_pmpy2_r (p3, h1, h2));
emit_insn (gen_pmpy2_l (p4, h1, h2));
s1 = gen_reg_rtx (V2SImode);
s2 = gen_reg_rtx (V2SImode);
s3 = gen_reg_rtx (V2SImode);
emit_insn (gen_addv2si3 (s1, p1, p2));
emit_insn (gen_addv2si3 (s2, p3, p4));
emit_insn (gen_addv2si3 (s3, s1, operands[3]));
emit_insn (gen_addv2si3 (operands[0], s2, s3));
}
/* Emit the appropriate sequence for a call. */
void
ia64_expand_call (rtx retval, rtx addr, rtx nextarg ATTRIBUTE_UNUSED,
int sibcall_p)
{
rtx insn, b0;
addr = XEXP (addr, 0);
addr = convert_memory_address (DImode, addr);
b0 = gen_rtx_REG (DImode, R_BR (0));
/* ??? Should do this for functions known to bind local too. */
if (TARGET_NO_PIC || TARGET_AUTO_PIC)
{
if (sibcall_p)
insn = gen_sibcall_nogp (addr);
else if (! retval)
insn = gen_call_nogp (addr, b0);
else
insn = gen_call_value_nogp (retval, addr, b0);
insn = emit_call_insn (insn);
}
else
{
if (sibcall_p)
insn = gen_sibcall_gp (addr);
else if (! retval)
insn = gen_call_gp (addr, b0);
else
insn = gen_call_value_gp (retval, addr, b0);
insn = emit_call_insn (insn);
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
}
if (sibcall_p)
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
if (TARGET_ABI_OPEN_VMS)
use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
gen_rtx_REG (DImode, GR_REG (25)));
}
static void
reg_emitted (enum ia64_frame_regs r)
{
if (emitted_frame_related_regs[r] == 0)
emitted_frame_related_regs[r] = current_frame_info.r[r];
else
gcc_assert (emitted_frame_related_regs[r] == current_frame_info.r[r]);
}
static int
get_reg (enum ia64_frame_regs r)
{
reg_emitted (r);
return current_frame_info.r[r];
}
static bool
is_emitted (int regno)
{
unsigned int r;
for (r = reg_fp; r < number_of_ia64_frame_regs; r++)
if (emitted_frame_related_regs[r] == regno)
return true;
return false;
}
void
ia64_reload_gp (void)
{
rtx tmp;
if (current_frame_info.r[reg_save_gp])
{
tmp = gen_rtx_REG (DImode, get_reg (reg_save_gp));
}
else
{
HOST_WIDE_INT offset;
rtx offset_r;
offset = (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size);
if (frame_pointer_needed)
{
tmp = hard_frame_pointer_rtx;
offset = -offset;
}
else
{
tmp = stack_pointer_rtx;
offset = current_frame_info.total_size - offset;
}
offset_r = GEN_INT (offset);
if (satisfies_constraint_I (offset_r))
emit_insn (gen_adddi3 (pic_offset_table_rtx, tmp, offset_r));
else
{
emit_move_insn (pic_offset_table_rtx, offset_r);
emit_insn (gen_adddi3 (pic_offset_table_rtx,
pic_offset_table_rtx, tmp));
}
tmp = gen_rtx_MEM (DImode, pic_offset_table_rtx);
}
emit_move_insn (pic_offset_table_rtx, tmp);
}
void
ia64_split_call (rtx retval, rtx addr, rtx retaddr, rtx scratch_r,
rtx scratch_b, int noreturn_p, int sibcall_p)
{
rtx insn;
bool is_desc = false;
/* If we find we're calling through a register, then we're actually
calling through a descriptor, so load up the values. */
if (REG_P (addr) && GR_REGNO_P (REGNO (addr)))
{
rtx tmp;
bool addr_dead_p;
/* ??? We are currently constrained to *not* use peep2, because
we can legitimately change the global lifetime of the GP
(in the form of killing where previously live). This is
because a call through a descriptor doesn't use the previous
value of the GP, while a direct call does, and we do not
commit to either form until the split here.
That said, this means that we lack precise life info for
whether ADDR is dead after this call. This is not terribly
important, since we can fix things up essentially for free
with the POST_DEC below, but it's nice to not use it when we
can immediately tell it's not necessary. */
addr_dead_p = ((noreturn_p || sibcall_p
|| TEST_HARD_REG_BIT (regs_invalidated_by_call,
REGNO (addr)))
&& !FUNCTION_ARG_REGNO_P (REGNO (addr)));
/* Load the code address into scratch_b. */
tmp = gen_rtx_POST_INC (Pmode, addr);
tmp = gen_rtx_MEM (Pmode, tmp);
emit_move_insn (scratch_r, tmp);
emit_move_insn (scratch_b, scratch_r);
/* Load the GP address. If ADDR is not dead here, then we must
revert the change made above via the POST_INCREMENT. */
if (!addr_dead_p)
tmp = gen_rtx_POST_DEC (Pmode, addr);
else
tmp = addr;
tmp = gen_rtx_MEM (Pmode, tmp);
emit_move_insn (pic_offset_table_rtx, tmp);
is_desc = true;
addr = scratch_b;
}
if (sibcall_p)
insn = gen_sibcall_nogp (addr);
else if (retval)
insn = gen_call_value_nogp (retval, addr, retaddr);
else
insn = gen_call_nogp (addr, retaddr);
emit_call_insn (insn);
if ((!TARGET_CONST_GP || is_desc) && !noreturn_p && !sibcall_p)
ia64_reload_gp ();
}
/* Expand an atomic operation. We want to perform MEM <CODE>= VAL atomically.
This differs from the generic code in that we know about the zero-extending
properties of cmpxchg, and the zero-extending requirements of ar.ccv. We
also know that ld.acq+cmpxchg.rel equals a full barrier.
The loop we want to generate looks like
cmp_reg = mem;
label:
old_reg = cmp_reg;
new_reg = cmp_reg op val;
cmp_reg = compare-and-swap(mem, old_reg, new_reg)
if (cmp_reg != old_reg)
goto label;
Note that we only do the plain load from memory once. Subsequent
iterations use the value loaded by the compare-and-swap pattern. */
void
ia64_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
rtx old_dst, rtx new_dst)
{
enum machine_mode mode = GET_MODE (mem);
rtx old_reg, new_reg, cmp_reg, ar_ccv, label;
enum insn_code icode;
/* Special case for using fetchadd. */
if ((mode == SImode || mode == DImode)
&& (code == PLUS || code == MINUS)
&& fetchadd_operand (val, mode))
{
if (code == MINUS)
val = GEN_INT (-INTVAL (val));
if (!old_dst)
old_dst = gen_reg_rtx (mode);
emit_insn (gen_memory_barrier ());
if (mode == SImode)
icode = CODE_FOR_fetchadd_acq_si;
else
icode = CODE_FOR_fetchadd_acq_di;
emit_insn (GEN_FCN (icode) (old_dst, mem, val));
if (new_dst)
{
new_reg = expand_simple_binop (mode, PLUS, old_dst, val, new_dst,
true, OPTAB_WIDEN);
if (new_reg != new_dst)
emit_move_insn (new_dst, new_reg);
}
return;
}
/* Because of the volatile mem read, we get an ld.acq, which is the
front half of the full barrier. The end half is the cmpxchg.rel. */
gcc_assert (MEM_VOLATILE_P (mem));
old_reg = gen_reg_rtx (DImode);
cmp_reg = gen_reg_rtx (DImode);
label = gen_label_rtx ();
if (mode != DImode)
{
val = simplify_gen_subreg (DImode, val, mode, 0);
emit_insn (gen_extend_insn (cmp_reg, mem, DImode, mode, 1));
}
else
emit_move_insn (cmp_reg, mem);
emit_label (label);
ar_ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM);
emit_move_insn (old_reg, cmp_reg);
emit_move_insn (ar_ccv, cmp_reg);
if (old_dst)
emit_move_insn (old_dst, gen_lowpart (mode, cmp_reg));
new_reg = cmp_reg;
if (code == NOT)
{
new_reg = expand_simple_binop (DImode, AND, new_reg, val, NULL_RTX,
true, OPTAB_DIRECT);
new_reg = expand_simple_unop (DImode, code, new_reg, NULL_RTX, true);
}
else
new_reg = expand_simple_binop (DImode, code, new_reg, val, NULL_RTX,
true, OPTAB_DIRECT);
if (mode != DImode)
new_reg = gen_lowpart (mode, new_reg);
if (new_dst)
emit_move_insn (new_dst, new_reg);
switch (mode)
{
case QImode: icode = CODE_FOR_cmpxchg_rel_qi; break;
case HImode: icode = CODE_FOR_cmpxchg_rel_hi; break;
case SImode: icode = CODE_FOR_cmpxchg_rel_si; break;
case DImode: icode = CODE_FOR_cmpxchg_rel_di; break;
default:
gcc_unreachable ();
}
emit_insn (GEN_FCN (icode) (cmp_reg, mem, ar_ccv, new_reg));
emit_cmp_and_jump_insns (cmp_reg, old_reg, NE, NULL, DImode, true, label);
}
/* Begin the assembly file. */
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
static void
ia64_file_start (void)
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
{
/* Variable tracking should be run after all optimizations which change order
of insns. It also needs a valid CFG. This can't be done in
ia64_override_options, because flag_var_tracking is finalized after
that. */
ia64_flag_var_tracking = flag_var_tracking;
flag_var_tracking = 0;
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
default_file_start ();
emit_safe_across_calls ();
}
void
emit_safe_across_calls (void)
{
unsigned int rs, re;
int out_state;
rs = 1;
out_state = 0;
while (1)
{
while (rs < 64 && call_used_regs[PR_REG (rs)])
rs++;
if (rs >= 64)
break;
for (re = rs + 1; re < 64 && ! call_used_regs[PR_REG (re)]; re++)
continue;
if (out_state == 0)
{
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
fputs ("\t.pred.safe_across_calls ", asm_out_file);
out_state = 1;
}
else
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
fputc (',', asm_out_file);
if (re == rs + 1)
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
fprintf (asm_out_file, "p%u", rs);
else
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
fprintf (asm_out_file, "p%u-p%u", rs, re - 1);
rs = re + 1;
}
if (out_state)
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
fputc ('\n', asm_out_file);
}
/* Globalize a declaration. */
static void
ia64_globalize_decl_name (FILE * stream, tree decl)
{
const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
tree version_attr = lookup_attribute ("version_id", DECL_ATTRIBUTES (decl));
if (version_attr)
{
tree v = TREE_VALUE (TREE_VALUE (version_attr));
const char *p = TREE_STRING_POINTER (v);
fprintf (stream, "\t.alias %s#, \"%s{%s}\"\n", name, name, p);
}
targetm.asm_out.globalize_label (stream, name);
if (TREE_CODE (decl) == FUNCTION_DECL)
ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "function");
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Helper function for ia64_compute_frame_size: find an appropriate general
register to spill some special register to. SPECIAL_SPILL_MASK contains
bits in GR0 to GR31 that have already been allocated by this routine.
TRY_LOCALS is true if we should attempt to locate a local regnum. */
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static int
find_gr_spill (enum ia64_frame_regs r, int try_locals)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int regno;
if (emitted_frame_related_regs[r] != 0)
{
regno = emitted_frame_related_regs[r];
if (regno >= LOC_REG (0) && regno < LOC_REG (80 - frame_pointer_needed)
&& current_frame_info.n_local_regs < regno - LOC_REG (0) + 1)
current_frame_info.n_local_regs = regno - LOC_REG (0) + 1;
else if (current_function_is_leaf
&& regno >= GR_REG (1) && regno <= GR_REG (31))
current_frame_info.gr_used_mask |= 1 << regno;
return regno;
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* If this is a leaf function, first try an otherwise unused
call-clobbered register. */
if (current_function_is_leaf)
{
for (regno = GR_REG (1); regno <= GR_REG (31); regno++)
if (! df_regs_ever_live_p (regno)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
&& call_used_regs[regno]
&& ! fixed_regs[regno]
&& ! global_regs[regno]
&& ((current_frame_info.gr_used_mask >> regno) & 1) == 0
&& ! is_emitted (regno))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
current_frame_info.gr_used_mask |= 1 << regno;
return regno;
}
}
if (try_locals)
{
regno = current_frame_info.n_local_regs;
/* If there is a frame pointer, then we can't use loc79, because
that is HARD_FRAME_POINTER_REGNUM. In particular, see the
reg_name switching code in ia64_expand_prologue. */
while (regno < (80 - frame_pointer_needed))
if (! is_emitted (LOC_REG (regno++)))
{
current_frame_info.n_local_regs = regno;
return LOC_REG (regno - 1);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
/* Failed to find a general register to spill to. Must use stack. */
return 0;
}
/* In order to make for nice schedules, we try to allocate every temporary
to a different register. We must of course stay away from call-saved,
fixed, and global registers. We must also stay away from registers
allocated in current_frame_info.gr_used_mask, since those include regs
used all through the prologue.
Any register allocated here must be used immediately. The idea is to
aid scheduling, not to solve data flow problems. */
static int last_scratch_gr_reg;
static int
next_scratch_gr_reg (void)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int i, regno;
for (i = 0; i < 32; ++i)
{
regno = (last_scratch_gr_reg + i + 1) & 31;
if (call_used_regs[regno]
&& ! fixed_regs[regno]
&& ! global_regs[regno]
&& ((current_frame_info.gr_used_mask >> regno) & 1) == 0)
{
last_scratch_gr_reg = regno;
return regno;
}
}
/* There must be _something_ available. */
gcc_unreachable ();
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
/* Helper function for ia64_compute_frame_size, called through
diddle_return_value. Mark REG in current_frame_info.gr_used_mask. */
static void
mark_reg_gr_used_mask (rtx reg, void *data ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
unsigned int regno = REGNO (reg);
if (regno < 32)
{
unsigned int i, n = hard_regno_nregs[regno][GET_MODE (reg)];
for (i = 0; i < n; ++i)
current_frame_info.gr_used_mask |= 1 << (regno + i);
}
2000-03-09 01:26:04 +01:00
}
2000-03-09 01:26:04 +01:00
/* Returns the number of bytes offset between the frame pointer and the stack
pointer for the current function. SIZE is the number of bytes of space
needed for local variables. */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static void
ia64_compute_frame_size (HOST_WIDE_INT size)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
HOST_WIDE_INT total_size;
HOST_WIDE_INT spill_size = 0;
HOST_WIDE_INT extra_spill_size = 0;
HOST_WIDE_INT pretend_args_size;
2000-03-09 01:26:04 +01:00
HARD_REG_SET mask;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
int n_spilled = 0;
int spilled_gr_p = 0;
int spilled_fr_p = 0;
unsigned int regno;
int min_regno;
int max_regno;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
int i;
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (current_frame_info.initialized)
return;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
memset (&current_frame_info, 0, sizeof current_frame_info);
2000-03-09 01:26:04 +01:00
CLEAR_HARD_REG_SET (mask);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Don't allocate scratches to the return register. */
diddle_return_value (mark_reg_gr_used_mask, NULL);
/* Don't allocate scratches to the EH scratch registers. */
if (cfun->machine->ia64_eh_epilogue_sp)
mark_reg_gr_used_mask (cfun->machine->ia64_eh_epilogue_sp, NULL);
if (cfun->machine->ia64_eh_epilogue_bsp)
mark_reg_gr_used_mask (cfun->machine->ia64_eh_epilogue_bsp, NULL);
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Find the size of the register stack frame. We have only 80 local
registers, because we reserve 8 for the inputs and 8 for the
outputs. */
/* Skip HARD_FRAME_POINTER_REGNUM (loc79) when frame_pointer_needed,
since we'll be adjusting that down later. */
regno = LOC_REG (78) + ! frame_pointer_needed;
for (; regno >= LOC_REG (0); regno--)
if (df_regs_ever_live_p (regno) && !is_emitted (regno))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
break;
current_frame_info.n_local_regs = regno - LOC_REG (0) + 1;
2000-03-09 01:26:04 +01:00
/* For functions marked with the syscall_linkage attribute, we must mark
all eight input registers as in use, so that locals aren't visible to
the caller. */
if (cfun->machine->n_varargs > 0
|| lookup_attribute ("syscall_linkage",
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
current_frame_info.n_input_regs = 8;
else
{
for (regno = IN_REG (7); regno >= IN_REG (0); regno--)
if (df_regs_ever_live_p (regno))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
break;
current_frame_info.n_input_regs = regno - IN_REG (0) + 1;
}
for (regno = OUT_REG (7); regno >= OUT_REG (0); regno--)
if (df_regs_ever_live_p (regno))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
break;
i = regno - OUT_REG (0) + 1;
#ifndef PROFILE_HOOK
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* When -p profiling, we need one output register for the mcount argument.
Likewise for -a profiling for the bb_init_func argument. For -ax
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
profiling, we need two output registers for the two bb_init_trace_func
arguments. */
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
if (crtl->profile)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
i = MAX (i, 1);
#endif
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
current_frame_info.n_output_regs = i;
/* ??? No rotating register support yet. */
current_frame_info.n_rotate_regs = 0;
/* Discover which registers need spilling, and how much room that
will take. Begin with floating point and general registers,
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
which will always wind up on the stack. */
for (regno = FR_REG (2); regno <= FR_REG (127); regno++)
if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
2000-03-09 01:26:04 +01:00
{
SET_HARD_REG_BIT (mask, regno);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
spill_size += 16;
n_spilled += 1;
spilled_fr_p = 1;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
for (regno = GR_REG (1); regno <= GR_REG (31); regno++)
if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
2000-03-09 01:26:04 +01:00
{
SET_HARD_REG_BIT (mask, regno);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
spill_size += 8;
n_spilled += 1;
spilled_gr_p = 1;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
for (regno = BR_REG (1); regno <= BR_REG (7); regno++)
if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
2000-03-09 01:26:04 +01:00
{
SET_HARD_REG_BIT (mask, regno);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
spill_size += 8;
n_spilled += 1;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Now come all special registers that might get saved in other
general registers. */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (frame_pointer_needed)
{
current_frame_info.r[reg_fp] = find_gr_spill (reg_fp, 1);
/* If we did not get a register, then we take LOC79. This is guaranteed
to be free, even if regs_ever_live is already set, because this is
HARD_FRAME_POINTER_REGNUM. This requires incrementing n_local_regs,
as we don't count loc79 above. */
if (current_frame_info.r[reg_fp] == 0)
{
current_frame_info.r[reg_fp] = LOC_REG (79);
current_frame_info.n_local_regs = LOC_REG (79) - LOC_REG (0) + 1;
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
if (! current_function_is_leaf)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Emit a save of BR0 if we call other functions. Do this even
if this function doesn't return, as EH depends on this to be
able to unwind the stack. */
SET_HARD_REG_BIT (mask, BR_REG (0));
current_frame_info.r[reg_save_b0] = find_gr_spill (reg_save_b0, 1);
if (current_frame_info.r[reg_save_b0] == 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
extra_spill_size += 8;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
n_spilled += 1;
}
/* Similarly for ar.pfs. */
SET_HARD_REG_BIT (mask, AR_PFS_REGNUM);
current_frame_info.r[reg_save_ar_pfs] = find_gr_spill (reg_save_ar_pfs, 1);
if (current_frame_info.r[reg_save_ar_pfs] == 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
extra_spill_size += 8;
n_spilled += 1;
}
/* Similarly for gp. Note that if we're calling setjmp, the stacked
registers are clobbered, so we fall back to the stack. */
current_frame_info.r[reg_save_gp]
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
= (cfun->calls_setjmp ? 0 : find_gr_spill (reg_save_gp, 1));
if (current_frame_info.r[reg_save_gp] == 0)
{
SET_HARD_REG_BIT (mask, GR_REG (1));
spill_size += 8;
n_spilled += 1;
}
2000-03-09 01:26:04 +01:00
}
else
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
if (df_regs_ever_live_p (BR_REG (0)) && ! call_used_regs[BR_REG (0)])
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
SET_HARD_REG_BIT (mask, BR_REG (0));
extra_spill_size += 8;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
n_spilled += 1;
}
if (df_regs_ever_live_p (AR_PFS_REGNUM))
{
SET_HARD_REG_BIT (mask, AR_PFS_REGNUM);
current_frame_info.r[reg_save_ar_pfs]
= find_gr_spill (reg_save_ar_pfs, 1);
if (current_frame_info.r[reg_save_ar_pfs] == 0)
{
extra_spill_size += 8;
n_spilled += 1;
}
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Unwind descriptor hackery: things are most efficient if we allocate
consecutive GR save registers for RP, PFS, FP in that order. However,
it is absolutely critical that FP get the only hard register that's
guaranteed to be free, so we allocated it first. If all three did
happen to be allocated hard regs, and are consecutive, rearrange them
into the preferred order now.
If we have already emitted code for any of those registers,
then it's already too late to change. */
min_regno = MIN (current_frame_info.r[reg_fp],
MIN (current_frame_info.r[reg_save_b0],
current_frame_info.r[reg_save_ar_pfs]));
max_regno = MAX (current_frame_info.r[reg_fp],
MAX (current_frame_info.r[reg_save_b0],
current_frame_info.r[reg_save_ar_pfs]));
if (min_regno > 0
&& min_regno + 2 == max_regno
&& (current_frame_info.r[reg_fp] == min_regno + 1
|| current_frame_info.r[reg_save_b0] == min_regno + 1
|| current_frame_info.r[reg_save_ar_pfs] == min_regno + 1)
&& (emitted_frame_related_regs[reg_save_b0] == 0
|| emitted_frame_related_regs[reg_save_b0] == min_regno)
&& (emitted_frame_related_regs[reg_save_ar_pfs] == 0
|| emitted_frame_related_regs[reg_save_ar_pfs] == min_regno + 1)
&& (emitted_frame_related_regs[reg_fp] == 0
|| emitted_frame_related_regs[reg_fp] == min_regno + 2))
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
{
current_frame_info.r[reg_save_b0] = min_regno;
current_frame_info.r[reg_save_ar_pfs] = min_regno + 1;
current_frame_info.r[reg_fp] = min_regno + 2;
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* See if we need to store the predicate register block. */
for (regno = PR_REG (0); regno <= PR_REG (63); regno++)
if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
break;
if (regno <= PR_REG (63))
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
SET_HARD_REG_BIT (mask, PR_REG (0));
current_frame_info.r[reg_save_pr] = find_gr_spill (reg_save_pr, 1);
if (current_frame_info.r[reg_save_pr] == 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
extra_spill_size += 8;
n_spilled += 1;
}
/* ??? Mark them all as used so that register renaming and such
are free to use them. */
for (regno = PR_REG (0); regno <= PR_REG (63); regno++)
df_set_regs_ever_live (regno, true);
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* If we're forced to use st8.spill, we're forced to save and restore
ar.unat as well. The check for existing liveness allows inline asm
to touch ar.unat. */
if (spilled_gr_p || cfun->machine->n_varargs
|| df_regs_ever_live_p (AR_UNAT_REGNUM))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
df_set_regs_ever_live (AR_UNAT_REGNUM, true);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
SET_HARD_REG_BIT (mask, AR_UNAT_REGNUM);
current_frame_info.r[reg_save_ar_unat]
= find_gr_spill (reg_save_ar_unat, spill_size == 0);
if (current_frame_info.r[reg_save_ar_unat] == 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
extra_spill_size += 8;
n_spilled += 1;
}
}
if (df_regs_ever_live_p (AR_LC_REGNUM))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
SET_HARD_REG_BIT (mask, AR_LC_REGNUM);
current_frame_info.r[reg_save_ar_lc]
= find_gr_spill (reg_save_ar_lc, spill_size == 0);
if (current_frame_info.r[reg_save_ar_lc] == 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
extra_spill_size += 8;
n_spilled += 1;
}
}
/* If we have an odd number of words of pretend arguments written to
the stack, then the FR save area will be unaligned. We round the
size of this area up to keep things 16 byte aligned. */
if (spilled_fr_p)
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
pretend_args_size = IA64_STACK_ALIGN (crtl->args.pretend_args_size);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
pretend_args_size = crtl->args.pretend_args_size;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
total_size = (spill_size + extra_spill_size + size + pretend_args_size
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
+ crtl->outgoing_args_size);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
total_size = IA64_STACK_ALIGN (total_size);
/* We always use the 16-byte scratch area provided by the caller, but
if we are a leaf function, there's no one to which we need to provide
a scratch area. */
if (current_function_is_leaf)
total_size = MAX (0, total_size - 16);
2000-03-09 01:26:04 +01:00
current_frame_info.total_size = total_size;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
current_frame_info.spill_cfa_off = pretend_args_size - 16;
current_frame_info.spill_size = spill_size;
current_frame_info.extra_spill_size = extra_spill_size;
2000-03-09 01:26:04 +01:00
COPY_HARD_REG_SET (current_frame_info.mask, mask);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
current_frame_info.n_spilled = n_spilled;
2000-03-09 01:26:04 +01:00
current_frame_info.initialized = reload_completed;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.c (hook_bool_const_int_const_int_true): New function. * target.h (struct gcc_target): Add can_eliminate field. * target-def.h (TARGET_CAN_ELIMINATE): Define. (TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE. * ira.c (setup_eliminable_regset): Use can_eliminate target hook. * reload1.c (update_eliminables, init_elim_table): (Ditto.). (elim_table): Revise comment. * system.h (CAN_ELIMINATE): Poison. * defaults.h (CAN_ELIMINATE): Remove. * doc/tm.texi (CAN_ELIMINATE): Revise documentation. * config/alpha/vms.h (CAN_ELIMINATE): Remove macro. * config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]: Define macro. (alpha_vms_can_eliminate): Declare as static, change return type to bool. * config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove. * config/arm/arm.h (CAN_ELIMINATE): Remove macro. * config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro. (arm_can_eliminate): New function. * config/avr/avr.h (CAN_ELIMINATE): Remove macro. * config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro. (avr_can_eliminate): Declare as static. * config/avr/avr-protos.h (avr_can_eliminate): Remove. * config/bfin/bfin.h (CAN_ELIMINATE): Remove macro. * config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro. (bfin_can_eliminate): New function. * config/crx/crx.h (CAN_ELIMINATE): Remove macro. * config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro. (crx_can_eliminate): New function. * config/fr30/fr30.h (CAN_ELIMINATE): Remove macro. * config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro. (fr30_can_eliminate): New function. * config/frv/frv.h (CAN_ELIMINATE): Remove macro. * config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro. (frv_can_eliminate): New function. * config/h8300/h8300.h (CAN_ELIMINATE): Remove macro. * config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro. (h8300_can_eliminate): New function. * config/i386/i386.h (CAN_ELIMINATE): Remove macro. * config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro. (i386_can_eliminate): Declare as static, change return type to bool. * config/i386/i386-protos.h (i386_can_eliminate): Remove. * config/ia64/ia64.h (CAN_ELIMINATE): Remove macro. * config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro. (ia64_can_eliminate): New function. * config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro. * config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro. (iq2000_can_eliminate): New function. * config/m32r/m32r.h (CAN_ELIMINATE): Remove macro. * config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro. (m32r_can_eliminate): New function. * config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro. * config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro. (m68hc11_can_eliminate): New function. * config/m68k/m68k.h (CAN_ELIMINATE): Remove macro. * config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro. (m68k_can_eliminate): New function. * config/mep/mep.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro. (mep_can_eliminate): New function. * config/mips/mips.h (CAN_ELIMINATE): Remove macro. * config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro. (mips_can_eliminate): New function. * config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro. * config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro. (rs6000_can_eliminate): New function. * config/s390/s390.h (CAN_ELIMINATE): Remove macro. * config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro. (s390_can_eliminate): Declare as static. * config/s390/s390-protos.h (sparc_can_eliminate): Remove. * config/score/score.h (CAN_ELIMINATE): Remove macro. * config/score/score.c (TARGET_CAN_ELIMINATE): Define macro. (score_can_eliminate): New function. * config/sparc/sparc.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro. (sparc_can_eliminate): Declare as static. * config/sparc/sparc-protos.h (sparc_can_eliminate): Remove. * config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro. * config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro. (xstormy16_can_eliminate): New function. * config/v850/v850.h (CAN_ELIMINATE): Remove macro. * config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro. (v850_can_eliminate): New function. From-SVN: r151096
2009-08-25 23:09:00 +02:00
/* Worker function for TARGET_CAN_ELIMINATE. */
bool
ia64_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
{
return (to == BR_REG (0) ? current_function_is_leaf : true);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Compute the initial difference between the specified pair of registers. */
HOST_WIDE_INT
ia64_initial_elimination_offset (int from, int to)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
HOST_WIDE_INT offset;
ia64_compute_frame_size (get_frame_size ());
switch (from)
{
case FRAME_POINTER_REGNUM:
switch (to)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
case HARD_FRAME_POINTER_REGNUM:
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (current_function_is_leaf)
offset = -current_frame_info.total_size;
else
offset = -(current_frame_info.total_size
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
- crtl->outgoing_args_size - 16);
break;
case STACK_POINTER_REGNUM:
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (current_function_is_leaf)
offset = 0;
else
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
offset = 16 + crtl->outgoing_args_size;
break;
default:
gcc_unreachable ();
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
break;
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
case ARG_POINTER_REGNUM:
/* Arguments start above the 16 byte save area, unless stdarg
in which case we store through the 16 byte save area. */
switch (to)
{
case HARD_FRAME_POINTER_REGNUM:
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
offset = 16 - crtl->args.pretend_args_size;
break;
case STACK_POINTER_REGNUM:
offset = (current_frame_info.total_size
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
+ 16 - crtl->args.pretend_args_size);
break;
default:
gcc_unreachable ();
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
break;
default:
gcc_unreachable ();
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
return offset;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* If there are more than a trivial number of register spills, we use
two interleaved iterators so that we can get two memory references
per insn group.
In order to simplify things in the prologue and epilogue expanders,
we use helper functions to fix up the memory references after the
fact with the appropriate offsets to a POST_MODIFY memory mode.
The following data structure tracks the state of the two iterators
while insns are being emitted. */
struct spill_fill_data
2000-03-09 01:26:04 +01:00
{
rtx init_after; /* point at which to emit initializations */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx init_reg[2]; /* initial base register */
rtx iter_reg[2]; /* the iterator registers */
rtx *prev_addr[2]; /* address of last memory use */
rtx prev_insn[2]; /* the insn corresponding to prev_addr */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
HOST_WIDE_INT prev_off[2]; /* last offset */
int n_iter; /* number of iterators in use */
int next_iter; /* next iterator to use */
unsigned int save_gr_used_mask;
};
static struct spill_fill_data spill_fill_data;
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static void
setup_spill_pointers (int n_spills, rtx init_reg, HOST_WIDE_INT cfa_off)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int i;
spill_fill_data.init_after = get_last_insn ();
spill_fill_data.init_reg[0] = init_reg;
spill_fill_data.init_reg[1] = init_reg;
spill_fill_data.prev_addr[0] = NULL;
spill_fill_data.prev_addr[1] = NULL;
spill_fill_data.prev_insn[0] = NULL;
spill_fill_data.prev_insn[1] = NULL;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
spill_fill_data.prev_off[0] = cfa_off;
spill_fill_data.prev_off[1] = cfa_off;
spill_fill_data.next_iter = 0;
spill_fill_data.save_gr_used_mask = current_frame_info.gr_used_mask;
spill_fill_data.n_iter = 1 + (n_spills > 2);
for (i = 0; i < spill_fill_data.n_iter; ++i)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
int regno = next_scratch_gr_reg ();
spill_fill_data.iter_reg[i] = gen_rtx_REG (DImode, regno);
current_frame_info.gr_used_mask |= 1 << regno;
}
}
static void
finish_spill_pointers (void)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
current_frame_info.gr_used_mask = spill_fill_data.save_gr_used_mask;
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static rtx
spill_restore_mem (rtx reg, HOST_WIDE_INT cfa_off)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int iter = spill_fill_data.next_iter;
HOST_WIDE_INT disp = spill_fill_data.prev_off[iter] - cfa_off;
rtx disp_rtx = GEN_INT (disp);
rtx mem;
if (spill_fill_data.prev_addr[iter])
{
if (satisfies_constraint_N (disp_rtx))
{
*spill_fill_data.prev_addr[iter]
= gen_rtx_POST_MODIFY (DImode, spill_fill_data.iter_reg[iter],
gen_rtx_PLUS (DImode,
spill_fill_data.iter_reg[iter],
disp_rtx));
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (spill_fill_data.prev_insn[iter],
REG_INC, spill_fill_data.iter_reg[iter]);
}
2000-03-09 01:26:04 +01:00
else
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* ??? Could use register post_modify for loads. */
if (!satisfies_constraint_I (disp_rtx))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
rtx tmp = gen_rtx_REG (DImode, next_scratch_gr_reg ());
emit_move_insn (tmp, disp_rtx);
disp_rtx = tmp;
}
emit_insn (gen_adddi3 (spill_fill_data.iter_reg[iter],
spill_fill_data.iter_reg[iter], disp_rtx));
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
/* Micro-optimization: if we've created a frame pointer, it's at
CFA 0, which may allow the real iterator to be initialized lower,
slightly increasing parallelism. Also, if there are few saves
it may eliminate the iterator entirely. */
else if (disp == 0
&& spill_fill_data.init_reg[iter] == stack_pointer_rtx
&& frame_pointer_needed)
{
mem = gen_rtx_MEM (GET_MODE (reg), hard_frame_pointer_rtx);
alias.c (set_mem_alias_set): New function. * alias.c (set_mem_alias_set): New function. * rtl.h (set_mem_alias_set): Declare it. * builtins.c (expand_builtin_return_addr): Call it instead of using MEM_ALIAS_SET accessor. (expand_builtin_setjmp_setup, expand_builtin_longjmp): Likewise. (get_memory_rtx, expand_builtin_va_arg): Likewise. (expand_builtin_va_copy):Likewise. * caller-save.c (setup_save_areas): Likewise. * calls.c (compute_argument_addresses): Likewise. * explow.c (set_mem_attributes): Likewise. * expr.c (emit_single_push_insn, emit_push_insn): Likewise. (expand_assignment, store_constructor_field, store_field): Likewise. (expand_expr_unaligned): Likewise. * function.c (assign_stack_temp_for_type): Likewise. (put_reg_into_stack, gen_mem_addressof): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * reload1.c (reload, alter_reg): Likewise. * config/alpha/alpha.c (get_aligned_mem): Likewise. (alpha_set_memflags_1, alpha_expand_unaligned_load): Likewise. (alpha_expand_unaligned_store): Likewise (alpha_expand_unaligned_load_words): Likewise. (alpha_expand_unaligned_store_words): Likewise. (alpha_expand_block_clear, alpha_expand_prologue): Likewise. (alpha_expand_epilogue): Likewise. * config/arc/arc.c (arc_setup_incoming_varargs): Likewise. * config/clipper/clipper.c (clipper_builtin_saveregs): Likewise. * config/i386/i386.c (legitimize_pic_address): Likewise. * config/i960/i960.c (setup_incoming_varargs): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. * config/m8k/m88k.c (m88k_builtin_saveregs): Likewise. * config/mips/mips.c (mips_va_arg): Likewise. * config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise. * config/pa/pa.c (hppa_builtin_saveregs): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. (setup_incoming_varargs, rs6000_va_arg): Likewise. (rs6000_emit_eh_toc_restore, rs6000_emit_prologue): Likewise. (rs6000_emit_epilogue): Likewise. * config/sh/sh.c (sh_builtin_saveregs): Likewise. * config/sparc/sparc.c (sparc_va_arg): Likewise. * config/v850/v850.c (v850_va_arg): Likewise. From-SVN: r43951
2001-07-11 22:35:55 +02:00
set_mem_alias_set (mem, get_varargs_alias_set ());
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return mem;
}
else
{
rtx seq, insn;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (disp == 0)
seq = gen_movdi (spill_fill_data.iter_reg[iter],
spill_fill_data.init_reg[iter]);
else
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
start_sequence ();
if (!satisfies_constraint_I (disp_rtx))
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx tmp = gen_rtx_REG (DImode, next_scratch_gr_reg ());
emit_move_insn (tmp, disp_rtx);
disp_rtx = tmp;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
emit_insn (gen_adddi3 (spill_fill_data.iter_reg[iter],
spill_fill_data.init_reg[iter],
disp_rtx));
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
seq = get_insns ();
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
end_sequence ();
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Careful for being the first insn in a sequence. */
if (spill_fill_data.init_after)
insn = emit_insn_after (seq, spill_fill_data.init_after);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
{
rtx first = get_insns ();
if (first)
insn = emit_insn_before (seq, first);
else
insn = emit_insn (seq);
}
spill_fill_data.init_after = insn;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
mem = gen_rtx_MEM (GET_MODE (reg), spill_fill_data.iter_reg[iter]);
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* ??? Not all of the spills are for varargs, but some of them are.
The rest of the spills belong in an alias set of their own. But
it doesn't actually hurt to include them here. */
alias.c (set_mem_alias_set): New function. * alias.c (set_mem_alias_set): New function. * rtl.h (set_mem_alias_set): Declare it. * builtins.c (expand_builtin_return_addr): Call it instead of using MEM_ALIAS_SET accessor. (expand_builtin_setjmp_setup, expand_builtin_longjmp): Likewise. (get_memory_rtx, expand_builtin_va_arg): Likewise. (expand_builtin_va_copy):Likewise. * caller-save.c (setup_save_areas): Likewise. * calls.c (compute_argument_addresses): Likewise. * explow.c (set_mem_attributes): Likewise. * expr.c (emit_single_push_insn, emit_push_insn): Likewise. (expand_assignment, store_constructor_field, store_field): Likewise. (expand_expr_unaligned): Likewise. * function.c (assign_stack_temp_for_type): Likewise. (put_reg_into_stack, gen_mem_addressof): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * reload1.c (reload, alter_reg): Likewise. * config/alpha/alpha.c (get_aligned_mem): Likewise. (alpha_set_memflags_1, alpha_expand_unaligned_load): Likewise. (alpha_expand_unaligned_store): Likewise (alpha_expand_unaligned_load_words): Likewise. (alpha_expand_unaligned_store_words): Likewise. (alpha_expand_block_clear, alpha_expand_prologue): Likewise. (alpha_expand_epilogue): Likewise. * config/arc/arc.c (arc_setup_incoming_varargs): Likewise. * config/clipper/clipper.c (clipper_builtin_saveregs): Likewise. * config/i386/i386.c (legitimize_pic_address): Likewise. * config/i960/i960.c (setup_incoming_varargs): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. * config/m8k/m88k.c (m88k_builtin_saveregs): Likewise. * config/mips/mips.c (mips_va_arg): Likewise. * config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise. * config/pa/pa.c (hppa_builtin_saveregs): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. (setup_incoming_varargs, rs6000_va_arg): Likewise. (rs6000_emit_eh_toc_restore, rs6000_emit_prologue): Likewise. (rs6000_emit_epilogue): Likewise. * config/sh/sh.c (sh_builtin_saveregs): Likewise. * config/sparc/sparc.c (sparc_va_arg): Likewise. * config/v850/v850.c (v850_va_arg): Likewise. From-SVN: r43951
2001-07-11 22:35:55 +02:00
set_mem_alias_set (mem, get_varargs_alias_set ());
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
spill_fill_data.prev_addr[iter] = &XEXP (mem, 0);
spill_fill_data.prev_off[iter] = cfa_off;
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (++iter >= spill_fill_data.n_iter)
iter = 0;
spill_fill_data.next_iter = iter;
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return mem;
}
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static void
do_spill (rtx (*move_fn) (rtx, rtx, rtx), rtx reg, HOST_WIDE_INT cfa_off,
rtx frame_reg)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int iter = spill_fill_data.next_iter;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx mem, insn;
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
mem = spill_restore_mem (reg, cfa_off);
insn = emit_insn ((*move_fn) (mem, reg, GEN_INT (cfa_off)));
spill_fill_data.prev_insn[iter] = insn;
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (frame_reg)
{
rtx base;
HOST_WIDE_INT off;
RTX_FRAME_RELATED_P (insn) = 1;
/* Don't even pretend that the unwind code can intuit its way
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
through a pair of interleaved post_modify iterators. Just
provide the correct answer. */
if (frame_pointer_needed)
{
base = hard_frame_pointer_rtx;
off = - cfa_off;
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
{
base = stack_pointer_rtx;
off = current_frame_info.total_size - cfa_off;
}
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode,
gen_rtx_MEM (GET_MODE (reg),
plus_constant (base, off)),
frame_reg));
2000-03-09 01:26:04 +01:00
}
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static void
do_restore (rtx (*move_fn) (rtx, rtx, rtx), rtx reg, HOST_WIDE_INT cfa_off)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int iter = spill_fill_data.next_iter;
rtx insn;
insn = emit_insn ((*move_fn) (reg, spill_restore_mem (reg, cfa_off),
GEN_INT (cfa_off)));
spill_fill_data.prev_insn[iter] = insn;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
/* Wrapper functions that discards the CONST_INT spill offset. These
exist so that we can give gr_spill/gr_fill the offset they need and
use a consistent function interface. */
static rtx
gen_movdi_x (rtx dest, rtx src, rtx offset ATTRIBUTE_UNUSED)
{
return gen_movdi (dest, src);
}
static rtx
gen_fr_spill_x (rtx dest, rtx src, rtx offset ATTRIBUTE_UNUSED)
{
return gen_fr_spill (dest, src);
}
static rtx
gen_fr_restore_x (rtx dest, rtx src, rtx offset ATTRIBUTE_UNUSED)
{
return gen_fr_restore (dest, src);
}
2000-03-09 01:26:04 +01:00
/* Called after register allocation to add any instructions needed for the
prologue. Using a prologue insn is favored compared to putting all of the
Makefile.in (final.o): Depend on target.h. * 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. From-SVN: r43817
2001-07-06 20:40:17 +02:00
instructions in output_function_prologue(), since it allows the scheduler
2000-03-09 01:26:04 +01:00
to intermix instructions with the saves of the caller saved registers. In
some cases, it might be necessary to emit a barrier instruction as the last
insn to prevent such scheduling.
Also any insns generated here should have RTX_FRAME_RELATED_P(insn) = 1
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
so that the debug info generation code can handle them properly.
The register save area is layed out like so:
cfa+16
[ varargs spill area ]
[ fr register spill area ]
[ br register spill area ]
[ ar register spill area ]
[ pr register spill area ]
[ gr register spill area ] */
2000-03-09 01:26:04 +01:00
/* ??? Get inefficient code when the frame size is larger than can fit in an
adds instruction. */
void
ia64_expand_prologue (void)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx insn, ar_pfs_save_reg, ar_unat_save_reg;
int i, epilogue_p, regno, alt_regno, cfa_off, n_varargs;
rtx reg, alt_reg;
ia64_compute_frame_size (get_frame_size ());
last_scratch_gr_reg = 15;
if (dump_file)
{
fprintf (dump_file, "ia64 frame related registers "
"recorded in current_frame_info.r[]:\n");
#define PRINTREG(a) if (current_frame_info.r[a]) \
fprintf(dump_file, "%s = %d\n", #a, current_frame_info.r[a])
PRINTREG(reg_fp);
PRINTREG(reg_save_b0);
PRINTREG(reg_save_pr);
PRINTREG(reg_save_ar_pfs);
PRINTREG(reg_save_ar_unat);
PRINTREG(reg_save_ar_lc);
PRINTREG(reg_save_gp);
#undef PRINTREG
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* If there is no epilogue, then we don't need some prologue insns.
We need to avoid emitting the dead prologue insns, because flow
will complain about them. */
2000-03-09 01:26:04 +01:00
if (optimize)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
edge e;
edge_iterator ei;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
backport: basic-block.h: Include vec.h, errors.h. 2004-09-24 Ben Elliston <bje@au.ibm.com> Steven Bosscher <stevenb@suse.de> Andrew Pinski <pinskia@physics.uc.edu> Merge from edge-vector-branch: * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). (struct edge_def): Remove pred_next, succ_next members. (struct basic_block_def): Remove pred, succ members. Add preds and succs members of type VEC(edge). (FALLTHRU_EDGE): Redefine using EDGE_SUCC. (BRANCH_EDGE): Likewise. (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. (edge_iterator): New. (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. (FOR_EACH_EDGE): New. * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros where applicable. (rotate_loop): Likewise. (find_traces_1_route): Likewise. (bb_to_key): Likewise. (connect_traces): Likewise. (copy_bb_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_up_fall_thru_edges): Likewise. (find_jump_block): Likewise. (fix_crossing_conditional_branches): Likewise. (fix_crossing_unconditional_branches): Likewise. (add_reg_crossing_jump_notes): Likewise. * bt-load.c (augment_live_range): Likewise. * cfg.c (clear_edges): Likewise. (unchecked_make_edge): Likewise. (cached_make_edge): Likewise. (make_single_succ_edge): Likewise. (remove_edge): Likewise. (redirect_edge_succ_nodup): Likewise. (check_bb_profile): Likewise. (dump_flow_info): Likewise. (alloc_aux_for_edges): Likewise. (clear_aux_for_edges): Likewise. (dump_cfg_bb_info): Likewise. * cfganal.c (forwarder_block_p): Likewise. (can_fallthru): Likewise. (could_fall_through): Likewise. (mark_dfs_back_edges): Likewise. (set_edge_can_fallthru_flag): Likewise. (find_unreachable_blocks): Likewise. (create_edge_list): Likewise. (verify_edge_list): Likewise. (add_noreturn_fake_exit_edges): Likewise. (connect_infinite_loops_to_exit): Likewise. (flow_reverse_top_sort_order_compute): Likewise. (flow_depth_first_order_compute): Likewise. (flow_preorder_transversal_compute): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (dfs_enumerate_from): Likewise. (compute_dominance_frontiers_1): Likewise. * cfgbuild.c (make_edges): Likewise. (compute_outgoing_frequencies): Likewise. (find_many_sub_basic_blocks): Likewise. (find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_simplify_condjump): Likewise. (thread_jump): Likewise. (try_forward_edges): Likewise. (merge_blocks_move): Likewise. (outgoing_edges_match): Likewise. (try_crossjump_to_edge): Likewise. (try_crossjump_bb): Likewise. (try_optimize_cfg): Likewise. (merge_seq_blocks): Likewise. * cfgexpand.c (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Likewise. (construct_init_block): Likewise. (construct_exit_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. (dump_bb): Likewise. (delete_basic_block): Likewise. (split_edge): Likewise. (merge_blocks): Likewise. (make_forwarder_block): Likewise. (tidy_fallthru_edges): Likewise. (can_duplicate_block_p): Likewise. (duplicate_block): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. (fixup_fallthru_exit_predecessor): Likewise. (can_copy_bbs_p): Likewise. (copy_bbs): Likewise. * cfgloop.c (flow_loops_cfg_dump): Likewise. (flow_loop_entry_edges_find): Likewise. (flow_loop_exit_edges_find): Likewise. (flow_loop_nodes_find): Likewise. (mark_single_exit_loops): Likewise. (flow_loop_pre_header_scan): Likewise. (flow_loop_pre_header_find): Likewise. (update_latch_info): Likewise. (canonicalize_loop_headers): Likewise. (flow_loops_find): Likewise. (get_loop_body_in_bfs_order): Likewise. (get_loop_exit_edges): Likewise. (num_loop_branches): Likewise. (verify_loop_structure): Likewise. (loop_latch_edge): Likewise. (loop_preheader_edge): Likewise. * cfgloopanal.c (mark_irreducible_loops): Likewise. (expected_loop_iterations): Likewise. * cfgloopmanip.c (remove_bbs): Likewise. (fix_bb_placement): Likewise. (fix_irreducible_loops): Likewise. (remove_path): Likewise. (scale_bbs_frequencies): Likewise. (loopify): Likewise. (unloop): Likewise. (fix_loop_placement): Likewise. (loop_delete_branch_edge): Likewise. (duplicate_loop_to_header_edge): Likewise. (mfb_keep_just): Likewise. (create_preheader): Likewise. (force_single_succ_latches): Likewise. (loop_split_edge_with): Likewise. (create_loop_notes): Likewise. * cfgrtl.c (rtl_split_block): Likewise. (rtl_merge_blocks): Likewise. (rtl_can_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. (rtl_tidy_fallthru_edge): Likewise. (commit_one_edge_insertion): Likewise. (commit_edge_insertions): Likewise. (commit_edge_insertions_watch_calls): Likewise. (rtl_verify_flow_info_1): Likewise. (rtl_verify_flow_info): Likewise. (purge_dead_edges): Likewise. (cfg_layout_redirect_edge_and_branch): Likewise. (cfg_layout_can_merge_blocks_p): Likewise. (rtl_flow_call_edges_add): Likewise. * cse.c (cse_cc_succs): Likewise. * df.c (hybrid_search): Likewise. * dominance.c (calc_dfs_tree_nonrec): Likewise. (calc_dfs_tree): Likewise. (calc_idoms): Likewise. (recount_dominator): Likewise. * domwalk.c (walk_dominator_tree): Likewise. * except.c (emit_to_new_bb_before): Likewise. (connect_post_landing_pads): Likewise. (sjlj_emit_function_enter): Likewise. (sjlj_emit_function_exit): Likewise. (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * flow.c (calculate_global_regs_live): Likewise. (initialize_uninitialized_subregs): Likewise. (init_propagate_block_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gcse.c (find_implicit_sets): Likewise. (bypass_block): Likewise. (bypass_conditional_jumps): Likewise. (compute_pre_data): Likewise. (insert_insn_end_bb): Likewise. (insert_store): Likewise. (remove_reachable_equiv_notes): Likewise. * global.c (global_conflicts): Likewise. (calculate_reg_pav): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * ifcvt.c (mark_loop_exit_edges): Likewise. (merge_if_block): Likewise. (find_if_header): Likewise. (block_jumps_and_fallthru_p): Likewise. (find_if_block): Likewise. (find_cond_trap): Likewise. (block_has_only_trap): Likewise. (find_if_case1): Likewise. (find_if_case_2): Likewise. * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. (perfect_nestify): Likewise. * lcm.c (compute_antinout_edge): Likewise. (compute_laterin): Likewise. (compute_available): Likewise. (compute_nearerout): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * loop-invariant.c (find_exits): Likewise. * loop-iv.c (simplify_using_initial_values): Likewise. (check_simple_exit): Likewise. (find_simple_exit): Likewise. * loop-unroll.c (peel_loop_completely): Likewise. (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. * loop-unswitch.c (may_unswitch_on): Likewise. (unswitch_loop): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. (sms_schedule): Likewise. * postreload-gcse.c (eliminate_partially_redundant_load): Likewise. * predict.c (can_predict_insn_p): Likewise. (set_even_probabilities): Likewise. (combine_predictions_for_bb): Likewise. (predict_loops): Likewise. (estimate_probability): Likewise. (tree_predict_by_opcode): Likewise. (tree_estimate_probability): Likewise. (last_basic_block_p): Likewise. (propagate_freq): Likewise. (estimate_loops_at_level): Likewise. (estimate_bb_frequencies): Likewise. * profile.c (instrument_edges): Likewise. (get_exec_counts): Likewise. (compute_branch_probabilities): Likewise. (branch_prob): Likewise. * ra-build.c (live_in): Likewise. * ra-rewrite.c (rewrite_program2): Likewise. * ra.c (reg_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_entry): Likewise. (compensate_edge): Likewise. (convert_regs_1): Likewise, (convert_regs_2): Likewise. (convert_regs): Likewise. * regrename.c (copyprop_hardreg_forward): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sbitmap.c (sbitmap_intersection_of_succs): Likewise. (sbitmap_insersection_of_preds): Likewise. (sbitmap_union_of_succs): Likewise. (sbitmap_union_of_preds): Likewise. * sched-ebb.c (compute_jump_reg_dependencies): Likewise. (fix_basic_block_boundaries): Likewise. (sched_ebbs): Likewise. * sched-rgn.c (build_control_flow): Likewise. (find_rgns): Likewise. * tracer.c (find_best_successor): Likewise. (find_best_predecessor): Likewise. (tail_duplicate): Likewise. * tree-cfg.c (make_edges): Likewise. (make_ctrl_stmt_edges): Likewise. (make_goto_expr_edges): Likewise. (tree_can_merge_blocks_p): Likewise. (tree_merge_blocks): Likewise. (cfg_remove_useless_stmts_bb): Likewise. (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. (tree_block_forwards_to): Likewise. (cleanup_control_expr_graph): Likewise. (find_taken_edge): Likewise. (dump_cfg_stats): Likewise. (tree_cfg2vcg): Likewise. (disband_implicit_edges): Likewise. (tree_find_edge_insert_loc): Likewise. (bsi_commit_edge_inserts): Likewise. (tree_split_edge): Likewise. (tree_verify_flow_info): Likewise. (tree_make_forwarder_block): Likewise. (tree_forwarder_block_p): Likewise. (thread_jumps): Likewise. (tree_try_redirect_by_replacing_jump): Likewise. (tree_split_block): Likewise. (add_phi_args_after_copy_bb): Likewise. (rewrite_to_new_ssa_names_bb): Likewise. (dump_function_to_file): Likewise. (print_pred_bbs): Likewise. (print_loop): Likewise. (tree_flow_call_edges_add): Likewise. (split_critical_edges): Likewise. (execute_warn_function_return): Likewise. (extract_true_false_edges_from_block): Likewise. * tree-if-conv.c (tree_if_conversion): Likewise. (if_convertable_bb_p): Likewise. (find_phi_replacement_condition): Likewise. (combine_blocks): Likewise. * tree-into-ssa.c (compute_global_livein): Likewise. (ssa_mark_phi_uses): Likewise. (ssa_rewrite_initialize_block): Likewise. (rewrite_add_phi_arguments): Likewise. (ssa_rewrite_phi_arguments): Likewise. (insert_phi_nodes_for): Likewise. (rewrite_into_ssa): Likewise. (rewrite_ssa_into_ssa): Likewise. * tree-mudflap.c (mf_build_check_statement_for): Likewise. * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. (rewrite_trees): Likewise. * tree-pretty-print.c (dump_bb_header): Likewise. (dump_implicit_edges): Likewise. * tree-sra.c (insert_edge_copies): Likewise. (find_obviously_necessary_stmts): Likewise. (remove_data_stmt): Likewise. * tree-ssa-dom.c (thread_across_edge): Likewise. (dom_opt_finalize_block): Likewise. (single_incoming_edge_ignoring_loop_edges): Likewise. (record_equivalences_from_incoming_edges): Likewise. (cprop_into_successor_phis): Likewise. * tree-ssa-live.c (live_worklist): Likewise. (calculate_live_on_entry): Likewise. (calculate_live_on_exit): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. (copy_loop_headers): Likewise. * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. (fill_always_executed_in): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. (compute_phi_arg_on_exit): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. (get_loops_exit): Likewise. (split_loop_exit_edge): Likewise. (ip_normal_pos): Likewise. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. (replace_phi_with_stmt): Likewise. (value_replacement): Likewise. * tree-ssa-pre.c (compute_antic_aux): Likewise. (insert_aux): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (simulate_stmt): Likewise. (simulate_block): Likewise. (ssa_prop_init): Likewise. * tree-ssa-threadupdate.c (thread_block): Likewise. (create_block_for_threading): Likewise. (remove_last_stmt_and_useless_edges): Likewise. * tree-ssa.c (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree_tailcall.c (independent_of_stmt_p): Likewise. (find_tail_calls): Likewise. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-vectorizer.c (vect_transform_loop): Likewise. * var-tracking.c (prologue_stack_adjust): Likewise. (vt_stack_adjustments): Likewise. (vt_find_locations): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/i386/i386.c (ix86_pad_returns): Likewise. * config/ia64/ia64.c (ia64_expand_prologue): Likewise. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Steven Bosscher <stevenb@suse.de> From-SVN: r88222
2004-09-28 09:59:54 +02:00
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
2000-03-09 01:26:04 +01:00
if ((e->flags & EDGE_FAKE) == 0
&& (e->flags & EDGE_FALLTHRU) != 0)
break;
epilogue_p = (e != NULL);
}
else
epilogue_p = 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Set the local, input, and output register names. We need to do this
for GNU libc, which creates crti.S/crtn.S by splitting initfini.c in
half. If we use in/loc/out register names, then we get assembler errors
in crtn.S because there is no alloc insn or regstk directive in there. */
if (! TARGET_REG_NAMES)
{
int inputs = current_frame_info.n_input_regs;
int locals = current_frame_info.n_local_regs;
int outputs = current_frame_info.n_output_regs;
for (i = 0; i < inputs; i++)
reg_names[IN_REG (i)] = ia64_reg_numbers[i];
for (i = 0; i < locals; i++)
reg_names[LOC_REG (i)] = ia64_reg_numbers[inputs + i];
for (i = 0; i < outputs; i++)
reg_names[OUT_REG (i)] = ia64_reg_numbers[inputs + locals + i];
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Set the frame pointer register name. The regnum is logically loc79,
but of course we'll not have allocated that many locals. Rather than
worrying about renumbering the existing rtxs, we adjust the name. */
/* ??? This code means that we can never use one local register when
there is a frame pointer. loc79 gets wasted in this case, as it is
renamed to a register that will never be used. See also the try_locals
code in find_gr_spill. */
if (current_frame_info.r[reg_fp])
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
const char *tmp = reg_names[HARD_FRAME_POINTER_REGNUM];
reg_names[HARD_FRAME_POINTER_REGNUM]
= reg_names[current_frame_info.r[reg_fp]];
reg_names[current_frame_info.r[reg_fp]] = tmp;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* We don't need an alloc instruction if we've used no outputs or locals. */
if (current_frame_info.n_local_regs == 0
&& current_frame_info.n_output_regs == 0
function.h (incomming_args): Break out of struct function. * function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
2008-04-08 10:59:34 +02:00
&& current_frame_info.n_input_regs <= crtl->args.info.int_regs
&& !TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
/* If there is no alloc, but there are input registers used, then we
need a .regstk directive. */
current_frame_info.need_regstk = (TARGET_REG_NAMES != 0);
ar_pfs_save_reg = NULL_RTX;
}
else
{
current_frame_info.need_regstk = 0;
2000-03-09 01:26:04 +01:00
if (current_frame_info.r[reg_save_ar_pfs])
{
regno = current_frame_info.r[reg_save_ar_pfs];
reg_emitted (reg_save_ar_pfs);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
regno = next_scratch_gr_reg ();
ar_pfs_save_reg = gen_rtx_REG (DImode, regno);
insn = emit_insn (gen_alloc (ar_pfs_save_reg,
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
GEN_INT (current_frame_info.n_input_regs),
GEN_INT (current_frame_info.n_local_regs),
GEN_INT (current_frame_info.n_output_regs),
GEN_INT (current_frame_info.n_rotate_regs)));
RTX_FRAME_RELATED_P (insn) = (current_frame_info.r[reg_save_ar_pfs] != 0);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Set up frame pointer, stack pointer, and spill iterators. */
2000-03-09 01:26:04 +01:00
n_varargs = cfun->machine->n_varargs;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
setup_spill_pointers (current_frame_info.n_spilled + n_varargs,
stack_pointer_rtx, 0);
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (frame_pointer_needed)
{
insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (current_frame_info.total_size != 0)
{
rtx frame_size_rtx = GEN_INT (- current_frame_info.total_size);
rtx offset;
2000-03-09 01:26:04 +01:00
if (satisfies_constraint_I (frame_size_rtx))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
offset = frame_size_rtx;
else
{
regno = next_scratch_gr_reg ();
offset = gen_rtx_REG (DImode, regno);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
emit_move_insn (offset, frame_size_rtx);
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
insn = emit_insn (gen_adddi3 (stack_pointer_rtx,
stack_pointer_rtx, offset));
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (! frame_pointer_needed)
{
RTX_FRAME_RELATED_P (insn) = 1;
if (GET_CODE (offset) != CONST_INT)
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
gen_rtx_PLUS (DImode,
stack_pointer_rtx,
frame_size_rtx)));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* ??? At this point we must generate a magic insn that appears to
modify the stack pointer, the frame pointer, and all spill
iterators. This would allow the most scheduling freedom. For
now, just hard stop. */
emit_insn (gen_blockage ());
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Must copy out ar.unat before doing any integer spills. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_UNAT_REGNUM))
2000-03-09 01:26:04 +01:00
{
if (current_frame_info.r[reg_save_ar_unat])
{
ar_unat_save_reg
= gen_rtx_REG (DImode, current_frame_info.r[reg_save_ar_unat]);
reg_emitted (reg_save_ar_unat);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
alt_regno = next_scratch_gr_reg ();
ar_unat_save_reg = gen_rtx_REG (DImode, alt_regno);
current_frame_info.gr_used_mask |= 1 << alt_regno;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
reg = gen_rtx_REG (DImode, AR_UNAT_REGNUM);
insn = emit_move_insn (ar_unat_save_reg, reg);
RTX_FRAME_RELATED_P (insn) = (current_frame_info.r[reg_save_ar_unat] != 0);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p && current_frame_info.r[reg_save_ar_unat])
emit_insn (gen_prologue_use (ar_unat_save_reg));
2000-03-09 01:26:04 +01:00
}
else
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
ar_unat_save_reg = NULL_RTX;
/* Spill all varargs registers. Do this before spilling any GR registers,
since we want the UNAT bits for the GR registers to override the UNAT
bits from varargs, which we don't care about. */
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off = -16;
for (regno = GR_ARG_FIRST + 7; n_varargs > 0; --n_varargs, --regno)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
reg = gen_rtx_REG (DImode, regno);
do_spill (gen_gr_spill, reg, cfa_off += 8, NULL_RTX);
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Locate the bottom of the register save area. */
cfa_off = (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size
+ current_frame_info.extra_spill_size);
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Save the predicate register block either in a register or in memory. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, PR_REG (0)))
{
reg = gen_rtx_REG (DImode, PR_REG (0));
if (current_frame_info.r[reg_save_pr] != 0)
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_pr]);
reg_emitted (reg_save_pr);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
insn = emit_move_insn (alt_reg, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* ??? Denote pr spill/fill by a DImode move that modifies all
64 hard registers. */
RTX_FRAME_RELATED_P (insn) = 1;
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, alt_reg, reg));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p)
emit_insn (gen_prologue_use (alt_reg));
}
else
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
insn = emit_move_insn (alt_reg, reg);
do_spill (gen_movdi_x, alt_reg, cfa_off, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Handle AR regs in numerical order. All of them get special handling. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_UNAT_REGNUM)
&& current_frame_info.r[reg_save_ar_unat] == 0)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
reg = gen_rtx_REG (DImode, AR_UNAT_REGNUM);
do_spill (gen_movdi_x, ar_unat_save_reg, cfa_off, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* The alloc insn already copied ar.pfs into a general register. The
only thing we have to do now is copy that register to a stack slot
if we'd not allocated a local register for the job. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM)
&& current_frame_info.r[reg_save_ar_pfs] == 0)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
do_spill (gen_movdi_x, ar_pfs_save_reg, cfa_off, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_LC_REGNUM))
{
reg = gen_rtx_REG (DImode, AR_LC_REGNUM);
if (current_frame_info.r[reg_save_ar_lc] != 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_ar_lc]);
reg_emitted (reg_save_ar_lc);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
insn = emit_move_insn (alt_reg, reg);
RTX_FRAME_RELATED_P (insn) = 1;
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p)
emit_insn (gen_prologue_use (alt_reg));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
2000-03-09 01:26:04 +01:00
else
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
emit_move_insn (alt_reg, reg);
do_spill (gen_movdi_x, alt_reg, cfa_off, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
}
/* Save the return pointer. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0)))
{
reg = gen_rtx_REG (DImode, BR_REG (0));
if (current_frame_info.r[reg_save_b0] != 0)
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_b0]);
reg_emitted (reg_save_b0);
insn = emit_move_insn (alt_reg, reg);
RTX_FRAME_RELATED_P (insn) = 1;
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p)
emit_insn (gen_prologue_use (alt_reg));
}
else
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
emit_move_insn (alt_reg, reg);
do_spill (gen_movdi_x, alt_reg, cfa_off, reg);
cfa_off -= 8;
}
}
if (current_frame_info.r[reg_save_gp])
{
reg_emitted (reg_save_gp);
insn = emit_move_insn (gen_rtx_REG (DImode,
current_frame_info.r[reg_save_gp]),
pic_offset_table_rtx);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* We should now be at the base of the gr/br/fr spill area. */
gcc_assert (cfa_off == (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Spill all general registers. */
for (regno = GR_REG (1); regno <= GR_REG (31); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
reg = gen_rtx_REG (DImode, regno);
do_spill (gen_gr_spill, reg, cfa_off, reg);
cfa_off -= 8;
}
/* Spill the rest of the BR registers. */
for (regno = BR_REG (1); regno <= BR_REG (7); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
reg = gen_rtx_REG (DImode, regno);
emit_move_insn (alt_reg, reg);
do_spill (gen_movdi_x, alt_reg, cfa_off, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
/* Align the frame and spill all FR registers. */
for (regno = FR_REG (2); regno <= FR_REG (127); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
gcc_assert (!(cfa_off & 15));
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
reg = gen_rtx_REG (XFmode, regno);
do_spill (gen_fr_spill_x, reg, cfa_off, reg);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 16;
}
gcc_assert (cfa_off == current_frame_info.spill_cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
finish_spill_pointers ();
2000-03-09 01:26:04 +01:00
}
/* Called after register allocation to add any instructions needed for the
epilogue. Using an epilogue insn is favored compared to putting all of the
Makefile.in (final.o): Depend on target.h. * 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. From-SVN: r43817
2001-07-06 20:40:17 +02:00
instructions in output_function_prologue(), since it allows the scheduler
2000-03-09 01:26:04 +01:00
to intermix instructions with the saves of the caller saved registers. In
some cases, it might be necessary to emit a barrier instruction as the last
insn to prevent such scheduling. */
void
ia64_expand_epilogue (int sibcall_p)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx insn, reg, alt_reg, ar_unat_save_reg;
int regno, alt_regno, cfa_off;
ia64_compute_frame_size (get_frame_size ());
/* If there is a frame pointer, then we use it instead of the stack
pointer, so that the stack pointer does not need to be valid when
the epilogue starts. See EXIT_IGNORE_STACK. */
if (frame_pointer_needed)
setup_spill_pointers (current_frame_info.n_spilled,
hard_frame_pointer_rtx, 0);
else
setup_spill_pointers (current_frame_info.n_spilled, stack_pointer_rtx,
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
current_frame_info.total_size);
if (current_frame_info.total_size != 0)
{
/* ??? At this point we must generate a magic insn that appears to
modify the spill iterators and the frame pointer. This would
allow the most scheduling freedom. For now, just hard stop. */
emit_insn (gen_blockage ());
}
/* Locate the bottom of the register save area. */
cfa_off = (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size
+ current_frame_info.extra_spill_size);
/* Restore the predicate registers. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, PR_REG (0)))
{
if (current_frame_info.r[reg_save_pr] != 0)
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_pr]);
reg_emitted (reg_save_pr);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
do_restore (gen_movdi_x, alt_reg, cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
reg = gen_rtx_REG (DImode, PR_REG (0));
emit_move_insn (reg, alt_reg);
}
/* Restore the application registers. */
/* Load the saved unat from the stack, but do not restore it until
after the GRs have been restored. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_UNAT_REGNUM))
{
if (current_frame_info.r[reg_save_ar_unat] != 0)
{
ar_unat_save_reg
= gen_rtx_REG (DImode, current_frame_info.r[reg_save_ar_unat]);
reg_emitted (reg_save_ar_unat);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
{
alt_regno = next_scratch_gr_reg ();
ar_unat_save_reg = gen_rtx_REG (DImode, alt_regno);
current_frame_info.gr_used_mask |= 1 << alt_regno;
do_restore (gen_movdi_x, ar_unat_save_reg, cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
}
else
ar_unat_save_reg = NULL_RTX;
if (current_frame_info.r[reg_save_ar_pfs] != 0)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
reg_emitted (reg_save_ar_pfs);
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_ar_pfs]);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
emit_move_insn (reg, alt_reg);
}
else if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
do_restore (gen_movdi_x, alt_reg, cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
emit_move_insn (reg, alt_reg);
}
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_LC_REGNUM))
{
if (current_frame_info.r[reg_save_ar_lc] != 0)
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_ar_lc]);
reg_emitted (reg_save_ar_lc);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
else
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
do_restore (gen_movdi_x, alt_reg, cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
}
reg = gen_rtx_REG (DImode, AR_LC_REGNUM);
emit_move_insn (reg, alt_reg);
}
/* Restore the return pointer. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0)))
{
if (current_frame_info.r[reg_save_b0] != 0)
{
alt_reg = gen_rtx_REG (DImode, current_frame_info.r[reg_save_b0]);
reg_emitted (reg_save_b0);
}
else
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
do_restore (gen_movdi_x, alt_reg, cfa_off);
cfa_off -= 8;
}
reg = gen_rtx_REG (DImode, BR_REG (0));
emit_move_insn (reg, alt_reg);
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* We should now be at the base of the gr/br/fr spill area. */
gcc_assert (cfa_off == (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* The GP may be stored on the stack in the prologue, but it's
never restored in the epilogue. Skip the stack slot. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, GR_REG (1)))
cfa_off -= 8;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Restore all general registers. */
for (regno = GR_REG (2); regno <= GR_REG (31); ++regno)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
reg = gen_rtx_REG (DImode, regno);
do_restore (gen_gr_restore, reg, cfa_off);
cfa_off -= 8;
}
/* Restore the branch registers. */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
for (regno = BR_REG (1); regno <= BR_REG (7); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
do_restore (gen_movdi_x, alt_reg, cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 8;
reg = gen_rtx_REG (DImode, regno);
emit_move_insn (reg, alt_reg);
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Restore floating point registers. */
for (regno = FR_REG (2); regno <= FR_REG (127); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
{
gcc_assert (!(cfa_off & 15));
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
reg = gen_rtx_REG (XFmode, regno);
do_restore (gen_fr_restore_x, reg, cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
cfa_off -= 16;
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Restore ar.unat for real. */
if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_UNAT_REGNUM))
{
reg = gen_rtx_REG (DImode, AR_UNAT_REGNUM);
emit_move_insn (reg, ar_unat_save_reg);
2000-03-09 01:26:04 +01:00
}
gcc_assert (cfa_off == current_frame_info.spill_cfa_off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
finish_spill_pointers ();
2000-03-09 01:26:04 +01:00
if (current_frame_info.total_size
|| cfun->machine->ia64_eh_epilogue_sp
|| frame_pointer_needed)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
/* ??? At this point we must generate a magic insn that appears to
modify the spill iterators, the stack pointer, and the frame
pointer. This would allow the most scheduling freedom. For now,
just hard stop. */
emit_insn (gen_blockage ());
}
2000-03-09 01:26:04 +01:00
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (cfun->machine->ia64_eh_epilogue_sp)
emit_move_insn (stack_pointer_rtx, cfun->machine->ia64_eh_epilogue_sp);
else if (frame_pointer_needed)
{
insn = emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
}
else if (current_frame_info.total_size)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx offset, frame_size_rtx;
frame_size_rtx = GEN_INT (current_frame_info.total_size);
if (satisfies_constraint_I (frame_size_rtx))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
offset = frame_size_rtx;
else
{
regno = next_scratch_gr_reg ();
offset = gen_rtx_REG (DImode, regno);
emit_move_insn (offset, frame_size_rtx);
}
insn = emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
offset));
RTX_FRAME_RELATED_P (insn) = 1;
if (GET_CODE (offset) != CONST_INT)
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
gen_rtx_PLUS (DImode,
stack_pointer_rtx,
frame_size_rtx)));
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (cfun->machine->ia64_eh_epilogue_bsp)
emit_insn (gen_set_bsp (cfun->machine->ia64_eh_epilogue_bsp));
if (! sibcall_p)
emit_jump_insn (gen_return_internal (gen_rtx_REG (DImode, BR_REG (0))));
else
{
int fp = GR_REG (2);
/* We need a throw away register here, r0 and r1 are reserved, so r2 is the
first available call clobbered register. If there was a frame_pointer
register, we may have swapped the names of r2 and HARD_FRAME_POINTER_REGNUM,
so we have to make sure we're using the string "r2" when emitting
the register name for the assembler. */
if (current_frame_info.r[reg_fp]
&& current_frame_info.r[reg_fp] == GR_REG (2))
fp = HARD_FRAME_POINTER_REGNUM;
/* We must emit an alloc to force the input registers to become output
registers. Otherwise, if the callee tries to pass its parameters
through to another call without an intervening alloc, then these
values get lost. */
/* ??? We don't need to preserve all input registers. We only need to
preserve those input registers used as arguments to the sibling call.
It is unclear how to compute that number here. */
if (current_frame_info.n_input_regs != 0)
{
rtx n_inputs = GEN_INT (current_frame_info.n_input_regs);
insn = emit_insn (gen_alloc (gen_rtx_REG (DImode, fp),
const0_rtx, const0_rtx,
n_inputs, const0_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
}
}
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Return 1 if br.ret can do all the work required to return from a
function. */
int
ia64_direct_return (void)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
if (reload_completed && ! frame_pointer_needed)
{
ia64_compute_frame_size (get_frame_size ());
return (current_frame_info.total_size == 0
&& current_frame_info.n_spilled == 0
&& current_frame_info.r[reg_save_b0] == 0
&& current_frame_info.r[reg_save_pr] == 0
&& current_frame_info.r[reg_save_ar_pfs] == 0
&& current_frame_info.r[reg_save_ar_unat] == 0
&& current_frame_info.r[reg_save_ar_lc] == 0);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
return 0;
}
/* Return the magic cookie that we use to hold the return address
during early compilation. */
rtx
ia64_return_addr_rtx (HOST_WIDE_INT count, rtx frame ATTRIBUTE_UNUSED)
{
if (count != 0)
return NULL;
return gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), UNSPEC_RET_ADDR);
}
/* Split this value after reload, now that we know where the return
address is saved. */
void
ia64_split_return_addr_rtx (rtx dest)
{
rtx src;
if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0)))
{
if (current_frame_info.r[reg_save_b0] != 0)
{
src = gen_rtx_REG (DImode, current_frame_info.r[reg_save_b0]);
reg_emitted (reg_save_b0);
}
else
{
HOST_WIDE_INT off;
unsigned int regno;
rtx off_r;
/* Compute offset from CFA for BR0. */
/* ??? Must be kept in sync with ia64_expand_prologue. */
off = (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size);
for (regno = GR_REG (1); regno <= GR_REG (31); ++regno)
if (TEST_HARD_REG_BIT (current_frame_info.mask, regno))
off -= 8;
/* Convert CFA offset to a register based offset. */
if (frame_pointer_needed)
src = hard_frame_pointer_rtx;
else
{
src = stack_pointer_rtx;
off += current_frame_info.total_size;
}
/* Load address into scratch register. */
off_r = GEN_INT (off);
if (satisfies_constraint_I (off_r))
emit_insn (gen_adddi3 (dest, src, off_r));
else
{
emit_move_insn (dest, off_r);
emit_insn (gen_adddi3 (dest, src, dest));
}
src = gen_rtx_MEM (Pmode, dest);
}
}
else
src = gen_rtx_REG (DImode, BR_REG (0));
emit_move_insn (dest, src);
}
int
ia64_hard_regno_rename_ok (int from, int to)
{
/* Don't clobber any of the registers we reserved for the prologue. */
unsigned int r;
for (r = reg_fp; r <= reg_save_ar_lc; r++)
if (to == current_frame_info.r[r]
|| from == current_frame_info.r[r]
|| to == emitted_frame_related_regs[r]
|| from == emitted_frame_related_regs[r])
return 0;
/* Don't use output registers outside the register frame. */
if (OUT_REGNO_P (to) && to >= OUT_REG (current_frame_info.n_output_regs))
return 0;
/* Retain even/oddness on predicate register pairs. */
if (PR_REGNO_P (from) && PR_REGNO_P (to))
return (from & 1) == (to & 1);
return 1;
}
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
/* Target hook for assembling integer objects. Handle word-sized
aligned objects and detect the cases when @fptr is needed. */
static bool
ia64_assemble_integer (rtx x, unsigned int size, int aligned_p)
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
{
if (size == POINTER_SIZE / BITS_PER_UNIT
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
&& !(TARGET_NO_PIC || TARGET_AUTO_PIC)
&& GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_FUNCTION_P (x))
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
{
static const char * const directive[2][2] = {
/* 64-bit pointer */ /* 32-bit pointer */
{ "\tdata8.ua\t@fptr(", "\tdata4.ua\t@fptr("}, /* unaligned */
{ "\tdata8\t@fptr(", "\tdata4\t@fptr("} /* aligned */
};
fputs (directive[(aligned_p != 0)][POINTER_SIZE == 32], asm_out_file);
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
output_addr_const (asm_out_file, x);
fputs (")\n", asm_out_file);
return true;
}
return default_assemble_integer (x, size, aligned_p);
}
2000-03-09 01:26:04 +01:00
/* Emit the function prologue. */
Makefile.in (final.o): Depend on target.h. * 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. From-SVN: r43817
2001-07-06 20:40:17 +02:00
static void
ia64_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
int mask, grsave, grsave_prev;
if (current_frame_info.need_regstk)
fprintf (file, "\t.regstk %d, %d, %d, %d\n",
current_frame_info.n_input_regs,
current_frame_info.n_local_regs,
current_frame_info.n_output_regs,
current_frame_info.n_rotate_regs);
2000-03-09 01:26:04 +01:00
if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
return;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Emit the .prologue directive. */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
mask = 0;
grsave = grsave_prev = 0;
if (current_frame_info.r[reg_save_b0] != 0)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
mask |= 8;
grsave = grsave_prev = current_frame_info.r[reg_save_b0];
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
if (current_frame_info.r[reg_save_ar_pfs] != 0
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
&& (grsave_prev == 0
|| current_frame_info.r[reg_save_ar_pfs] == grsave_prev + 1))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
mask |= 4;
if (grsave_prev == 0)
grsave = current_frame_info.r[reg_save_ar_pfs];
grsave_prev = current_frame_info.r[reg_save_ar_pfs];
}
if (current_frame_info.r[reg_fp] != 0
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
&& (grsave_prev == 0
|| current_frame_info.r[reg_fp] == grsave_prev + 1))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
mask |= 2;
if (grsave_prev == 0)
grsave = HARD_FRAME_POINTER_REGNUM;
grsave_prev = current_frame_info.r[reg_fp];
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
if (current_frame_info.r[reg_save_pr] != 0
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
&& (grsave_prev == 0
|| current_frame_info.r[reg_save_pr] == grsave_prev + 1))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
mask |= 1;
if (grsave_prev == 0)
grsave = current_frame_info.r[reg_save_pr];
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
if (mask && TARGET_GNU_AS)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
fprintf (file, "\t.prologue %d, %d\n", mask,
ia64_dbx_register_number (grsave));
else
fputs ("\t.prologue\n", file);
/* Emit a .spill directive, if necessary, to relocate the base of
the register spill area. */
if (current_frame_info.spill_cfa_off != -16)
fprintf (file, "\t.spill %ld\n",
(long) (current_frame_info.spill_cfa_off
+ current_frame_info.spill_size));
2000-03-09 01:26:04 +01:00
}
/* Emit the .body directive at the scheduled end of the prologue. */
static void
ia64_output_function_end_prologue (FILE *file)
{
if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
return;
fputs ("\t.body\n", file);
}
2000-03-09 01:26:04 +01:00
/* Emit the function epilogue. */
Makefile.in (final.o): Depend on target.h. * 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. From-SVN: r43817
2001-07-06 20:40:17 +02:00
static void
ia64_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
HOST_WIDE_INT size ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
int i;
if (current_frame_info.r[reg_fp])
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
const char *tmp = reg_names[HARD_FRAME_POINTER_REGNUM];
reg_names[HARD_FRAME_POINTER_REGNUM]
= reg_names[current_frame_info.r[reg_fp]];
reg_names[current_frame_info.r[reg_fp]] = tmp;
reg_emitted (reg_fp);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
}
if (! TARGET_REG_NAMES)
{
for (i = 0; i < current_frame_info.n_input_regs; i++)
reg_names[IN_REG (i)] = ia64_input_reg_names[i];
for (i = 0; i < current_frame_info.n_local_regs; i++)
reg_names[LOC_REG (i)] = ia64_local_reg_names[i];
for (i = 0; i < current_frame_info.n_output_regs; i++)
reg_names[OUT_REG (i)] = ia64_output_reg_names[i];
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
current_frame_info.initialized = 0;
}
2000-03-09 01:26:04 +01:00
int
ia64_dbx_register_number (int regno)
2000-03-09 01:26:04 +01:00
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* In ia64_expand_prologue we quite literally renamed the frame pointer
from its home at loc79 to something inside the register frame. We
must perform the same renumbering here for the debug info. */
if (current_frame_info.r[reg_fp])
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
if (regno == HARD_FRAME_POINTER_REGNUM)
regno = current_frame_info.r[reg_fp];
else if (regno == current_frame_info.r[reg_fp])
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
regno = HARD_FRAME_POINTER_REGNUM;
}
if (IN_REGNO_P (regno))
return 32 + regno - IN_REG (0);
else if (LOC_REGNO_P (regno))
return 32 + current_frame_info.n_input_regs + regno - LOC_REG (0);
else if (OUT_REGNO_P (regno))
return (32 + current_frame_info.n_input_regs
+ current_frame_info.n_local_regs + regno - OUT_REG (0));
else
return regno;
2000-03-09 01:26:04 +01:00
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
void
ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
rtx addr_reg, tramp, eight = GEN_INT (8);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* The Intel assembler requires that the global __ia64_trampoline symbol
be declared explicitly */
if (!TARGET_GNU_AS)
{
static bool declared_ia64_trampoline = false;
if (!declared_ia64_trampoline)
{
declared_ia64_trampoline = true;
(*targetm.asm_out.globalize_label) (asm_out_file,
"__ia64_trampoline");
}
}
/* Make sure addresses are Pmode even if we are in ILP32 mode. */
addr = convert_memory_address (Pmode, addr);
fnaddr = convert_memory_address (Pmode, fnaddr);
static_chain = convert_memory_address (Pmode, static_chain);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Load up our iterator. */
addr_reg = gen_reg_rtx (Pmode);
emit_move_insn (addr_reg, addr);
/* The first two words are the fake descriptor:
__ia64_trampoline, ADDR+16. */
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
tramp = gen_rtx_SYMBOL_REF (Pmode, "__ia64_trampoline");
if (TARGET_ABI_OPEN_VMS)
{
/* HP decided to break the ELF ABI on VMS (to deal with an ambiguity
in the Macro-32 compiler) and changed the semantics of the LTOFF22
relocation against function symbols to make it identical to the
LTOFF_FPTR22 relocation. Emit the latter directly to stay within
strict ELF and dereference to get the bare code address. */
rtx reg = gen_reg_rtx (Pmode);
SYMBOL_REF_FLAGS (tramp) |= SYMBOL_FLAG_FUNCTION;
emit_move_insn (reg, tramp);
emit_move_insn (reg, gen_rtx_MEM (Pmode, reg));
tramp = reg;
}
emit_move_insn (gen_rtx_MEM (Pmode, addr_reg), tramp);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
emit_move_insn (gen_rtx_MEM (Pmode, addr_reg),
copy_to_reg (plus_constant (addr, 16)));
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
/* The third word is the target descriptor. */
emit_move_insn (gen_rtx_MEM (Pmode, addr_reg), fnaddr);
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
/* The fourth word is the static chain. */
emit_move_insn (gen_rtx_MEM (Pmode, addr_reg), static_chain);
}
2000-03-09 01:26:04 +01:00
/* Do any needed setup for a variadic function. CUM has not been updated
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
for the last named argument which has type TYPE and mode MODE.
We generate the actual spill instructions during prologue generation. */
static void
ia64_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int * pretend_size,
int second_time ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
CUMULATIVE_ARGS next_cum = *cum;
varargs.h: Replace with stub which issues #error. * ginclude/varargs.h: Replace with stub which issues #error. * ginclude/stdarg.h: __builtin_stdarg_start is renamed __builtin_va_start. * builtins.def (BUILT_IN_VARARGS_START): Delete. (BUILT_IN_VA_START): New. * builtins.c (expand_builtin_va_start): Eliminate first argument and code to implement pre-ISO varargs. (std_expand_builtin_va_start): Ignore first argument; it is always 1. (expand_builtin): Handle BUILT_IN_VA_START and BUILT_IN_STDARG_START identically. Delete BUILT_IN_VARARGS_START case. * function.c (assign_parms): Delete hide_last_arg and all its uses. (mark_varargs): Delete function. * function.h (struct function): Delete 'varargs' bit. (current_function_varargs): Delete macro. * tree.h: Don't declare mark_varargs. * c-decl.c (c_function_varargs, c_mark_varargs): Delete. (c_expand_body): Don't call mark_varargs. * c-objc-common.c: Handle BUILT_IN_VA_START and BUILT_IN_STDARG_START identically. Delete BUILT_IN_VARARGS_START case. * c-tree.h: Don't declare c_mark_varargs. * c-parse.in: Remove grammar rules for '&...' (which has been commented out since before 2.7.2) and for '...' in K+R argument declarations. * builtins.c, function.c, integrate.c, sibcall.c, config/alpha/unicosmk.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr.c, config/cris/cris.c, config/fr30/fr30.c, config/i960/i960.c, config/i960/i960.md, config/m32r/m32r.c, config/m32r/m32r.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/mn10300/mn10300.c, config/pa/som.h, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.c: Delete all references to current_function_varargs, and code predicated on that flag. * config/alpha/alpha.c (alpha_va_start), config/arc/arc.c (arc_va_start), config/i386/i386.c (ix86_va_start), config/mips/mips.c (mips_va_start), config/mn10300/mn10300.c (mn10300_va_start), config/rs6000/rs6000.c (rs6000_va_start), config/s390/s390.c (s390_va_start), config/sh/sh.c (sh_va_start), Ignore first argument; it is always 1. * config/c4x/c4x-protos.h, config/c4x/c4x.c: Delete c4x_va_start. * config/ia64/ia64-protos.h, config/ia64/ia64.c: Delete ia64_va_start. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c: Delete m68hc11_va_start. * config/c4x/c4x.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h: No need to define EXPAND_BUILTIN_VA_START. * doc/invoke.texi, doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: Remove references to GCC-provided <varargs.h>. testsuite: * c-torture/execute/991216-3.c, c-torture/execute/strct-varg-1.c, c-torture/execute/va-arg-7.c, c-torture/execute/va-arg-8.c, c-torture/execute/va-arg-15.c, c-torture/execute/va-arg-16.c, c-torture/execute/va-arg-17.c, c-torture/execute/va-arg-19.c: Convert to use <stdarg.h>. * c-torture/execute/va-arg-3.c, c-torture/execute/va-arg-3.x: Delete. * gcc.dg/va-arg-2.c: New. * lib/gcc.exp, lib/objc.exp: Remove code to set -DNO_VARARGS. From-SVN: r55472
2002-07-16 04:16:47 +02:00
/* Skip the current argument. */
ia64_function_arg_advance (&next_cum, mode, type, 1);
2000-03-09 01:26:04 +01:00
if (next_cum.words < MAX_ARGUMENT_SLOTS)
{
int n = MAX_ARGUMENT_SLOTS - next_cum.words;
*pretend_size = n * UNITS_PER_WORD;
cfun->machine->n_varargs = n;
}
2000-03-09 01:26:04 +01:00
}
/* Check whether TYPE is a homogeneous floating point aggregate. If
it is, return the mode of the floating point type that appears
in all leafs. If it is not, return VOIDmode.
An aggregate is a homogeneous floating point aggregate is if all
fields/elements in it have the same floating point type (e.g,
SFmode). 128-bit quad-precision floats are excluded.
Variable sized aggregates should never arrive here, since we should
have already decided to pass them by reference. Top-level zero-sized
aggregates are excluded because our parallels crash the middle-end. */
2000-03-09 01:26:04 +01:00
static enum machine_mode
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
hfa_element_mode (const_tree type, bool nested)
2000-03-09 01:26:04 +01:00
{
enum machine_mode element_mode = VOIDmode;
enum machine_mode mode;
enum tree_code code = TREE_CODE (type);
int know_element_mode = 0;
tree t;
if (!nested && (!TYPE_SIZE (type) || integer_zerop (TYPE_SIZE (type))))
return VOIDmode;
2000-03-09 01:26:04 +01:00
switch (code)
{
case VOID_TYPE: case INTEGER_TYPE: case ENUMERAL_TYPE:
case BOOLEAN_TYPE: case POINTER_TYPE:
2000-03-09 01:26:04 +01:00
case OFFSET_TYPE: case REFERENCE_TYPE: case METHOD_TYPE:
case LANG_TYPE: case FUNCTION_TYPE:
2000-03-09 01:26:04 +01:00
return VOIDmode;
/* Fortran complex types are supposed to be HFAs, so we need to handle
gcc's COMPLEX_TYPEs as HFAs. We need to exclude the integral complex
types though. */
case COMPLEX_TYPE:
if (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_COMPLEX_FLOAT
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
&& TYPE_MODE (type) != TCmode)
return GET_MODE_INNER (TYPE_MODE (type));
2000-03-09 01:26:04 +01:00
else
return VOIDmode;
case REAL_TYPE:
/* We want to return VOIDmode for raw REAL_TYPEs, but the actual
mode if this is contained within an aggregate. */
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
if (nested && TYPE_MODE (type) != TFmode)
2000-03-09 01:26:04 +01:00
return TYPE_MODE (type);
else
return VOIDmode;
case ARRAY_TYPE:
return hfa_element_mode (TREE_TYPE (type), 1);
2000-03-09 01:26:04 +01:00
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t))
{
if (TREE_CODE (t) != FIELD_DECL)
continue;
mode = hfa_element_mode (TREE_TYPE (t), 1);
if (know_element_mode)
{
if (mode != element_mode)
return VOIDmode;
}
else if (GET_MODE_CLASS (mode) != MODE_FLOAT)
return VOIDmode;
else
{
know_element_mode = 1;
element_mode = mode;
}
}
return element_mode;
default:
/* If we reach here, we probably have some front-end specific type
that the backend doesn't know about. This can happen via the
aggregate_value_p call in init_function_start. All we can do is
ignore unknown tree types. */
return VOIDmode;
}
return VOIDmode;
}
/* Return the number of words required to hold a quantity of TYPE and MODE
when passed as an argument. */
static int
ia64_function_arg_words (tree type, enum machine_mode mode)
{
int words;
if (mode == BLKmode)
words = int_size_in_bytes (type);
else
words = GET_MODE_SIZE (mode);
return (words + UNITS_PER_WORD - 1) / UNITS_PER_WORD; /* round up */
}
/* Return the number of registers that should be skipped so the current
argument (described by TYPE and WORDS) will be properly aligned.
Integer and float arguments larger than 8 bytes start at the next
even boundary. Aggregates larger than 8 bytes start at the next
even boundary if the aggregate has 16 byte alignment. Note that
in the 32-bit ABI, TImode and TFmode have only 8-byte alignment
but are still to be aligned in registers.
??? The ABI does not specify how to handle aggregates with
alignment from 9 to 15 bytes, or greater than 16. We handle them
all as if they had 16 byte alignment. Such aggregates can occur
only if gcc extensions are used. */
static int
ia64_function_arg_offset (CUMULATIVE_ARGS *cum, tree type, int words)
{
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* No registers are skipped on VMS. */
if (TARGET_ABI_OPEN_VMS || (cum->words & 1) == 0)
return 0;
if (type
&& TREE_CODE (type) != INTEGER_TYPE
&& TREE_CODE (type) != REAL_TYPE)
return TYPE_ALIGN (type) > 8 * BITS_PER_UNIT;
else
return words > 1;
}
2000-03-09 01:26:04 +01:00
/* Return rtx for register where argument is passed, or zero if it is passed
on the stack. */
/* ??? 128-bit quad-precision floats are always passed in general
registers. */
rtx
ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
int named, int incoming)
2000-03-09 01:26:04 +01:00
{
int basereg = (incoming ? GR_ARG_FIRST : AR_ARG_FIRST);
int words = ia64_function_arg_words (type, mode);
int offset = ia64_function_arg_offset (cum, type, words);
2000-03-09 01:26:04 +01:00
enum machine_mode hfa_mode = VOIDmode;
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* For OPEN VMS, emit the instruction setting up the argument register here,
when we know this will be together with the other arguments setup related
insns. This is not the conceptually best place to do this, but this is
the easiest as we have convenient access to cumulative args info. */
if (TARGET_ABI_OPEN_VMS && mode == VOIDmode && type == void_type_node
&& named == 1)
{
unsigned HOST_WIDE_INT regval = cum->words;
int i;
for (i = 0; i < 8; i++)
regval |= ((int) cum->atypes[i]) << (i * 3 + 8);
emit_move_insn (gen_rtx_REG (DImode, GR_REG (25)),
GEN_INT (regval));
}
2000-03-09 01:26:04 +01:00
/* If all argument slots are used, then it must go on the stack. */
if (cum->words + offset >= MAX_ARGUMENT_SLOTS)
return 0;
/* Check for and handle homogeneous FP aggregates. */
if (type)
hfa_mode = hfa_element_mode (type, 0);
/* Unnamed prototyped hfas are passed as usual. Named prototyped hfas
and unprototyped hfas are passed specially. */
if (hfa_mode != VOIDmode && (! cum->prototype || named))
{
rtx loc[16];
int i = 0;
int fp_regs = cum->fp_regs;
int int_regs = cum->words + offset;
int hfa_size = GET_MODE_SIZE (hfa_mode);
int byte_size;
int args_byte_size;
/* If prototyped, pass it in FR regs then GR regs.
If not prototyped, pass it in both FR and GR regs.
If this is an SFmode aggregate, then it is possible to run out of
FR regs while GR regs are still left. In that case, we pass the
remaining part in the GR regs. */
/* Fill the FP regs. We do this always. We stop if we reach the end
of the argument, the last FP register, or the last argument slot. */
byte_size = ((mode == BLKmode)
? int_size_in_bytes (type) : GET_MODE_SIZE (mode));
args_byte_size = int_regs * UNITS_PER_WORD;
offset = 0;
for (; (offset < byte_size && fp_regs < MAX_ARGUMENT_SLOTS
&& args_byte_size < (MAX_ARGUMENT_SLOTS * UNITS_PER_WORD)); i++)
{
loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (hfa_mode, (FR_ARG_FIRST
+ fp_regs)),
GEN_INT (offset));
offset += hfa_size;
args_byte_size += hfa_size;
fp_regs++;
}
/* If no prototype, then the whole thing must go in GR regs. */
if (! cum->prototype)
offset = 0;
/* If this is an SFmode aggregate, then we might have some left over
that needs to go in GR regs. */
else if (byte_size != offset)
int_regs += offset / UNITS_PER_WORD;
/* Fill in the GR regs. We must use DImode here, not the hfa mode. */
for (; offset < byte_size && int_regs < MAX_ARGUMENT_SLOTS; i++)
{
enum machine_mode gr_mode = DImode;
unsigned int gr_size;
2000-03-09 01:26:04 +01:00
/* If we have an odd 4 byte hunk because we ran out of FR regs,
then this goes in a GR reg left adjusted/little endian, right
adjusted/big endian. */
/* ??? Currently this is handled wrong, because 4-byte hunks are
always right adjusted/little endian. */
if (offset & 0x4)
gr_mode = SImode;
/* If we have an even 4 byte hunk because the aggregate is a
multiple of 4 bytes in size, then this goes in a GR reg right
adjusted/little endian. */
else if (byte_size - offset == 4)
gr_mode = SImode;
loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (gr_mode, (basereg
+ int_regs)),
GEN_INT (offset));
gr_size = GET_MODE_SIZE (gr_mode);
offset += gr_size;
if (gr_size == UNITS_PER_WORD
|| (gr_size < UNITS_PER_WORD && offset % UNITS_PER_WORD == 0))
int_regs++;
else if (gr_size > UNITS_PER_WORD)
int_regs += gr_size / UNITS_PER_WORD;
2000-03-09 01:26:04 +01:00
}
return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
2000-03-09 01:26:04 +01:00
}
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* On OpenVMS variable argument is either in Rn or Fn. */
else if (TARGET_ABI_OPEN_VMS && named == 0)
{
if (FLOAT_MODE_P (mode))
return gen_rtx_REG (mode, FR_ARG_FIRST + cum->words);
else
return gen_rtx_REG (mode, basereg + cum->words);
}
2000-03-09 01:26:04 +01:00
/* Integral and aggregates go in general registers. If we have run out of
FR registers, then FP values must also go in general registers. This can
happen when we have a SFmode HFA. */
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
else if (mode == TFmode || mode == TCmode
|| (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS))
{
int byte_size = ((mode == BLKmode)
? int_size_in_bytes (type) : GET_MODE_SIZE (mode));
if (BYTES_BIG_ENDIAN
&& (mode == BLKmode || (type && AGGREGATE_TYPE_P (type)))
&& byte_size < UNITS_PER_WORD
&& byte_size > 0)
{
rtx gr_reg = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode,
(basereg + cum->words
+ offset)),
const0_rtx);
return gen_rtx_PARALLEL (mode, gen_rtvec (1, gr_reg));
}
else
return gen_rtx_REG (mode, basereg + cum->words + offset);
}
2000-03-09 01:26:04 +01:00
/* If there is a prototype, then FP values go in a FR register when
named, and in a GR register when unnamed. */
2000-03-09 01:26:04 +01:00
else if (cum->prototype)
{
if (named)
2000-03-09 01:26:04 +01:00
return gen_rtx_REG (mode, FR_ARG_FIRST + cum->fp_regs);
/* In big-endian mode, an anonymous SFmode value must be represented
as (parallel:SF [(expr_list (reg:DI n) (const_int 0))]) to force
the value into the high half of the general register. */
else if (BYTES_BIG_ENDIAN && mode == SFmode)
return gen_rtx_PARALLEL (mode,
gen_rtvec (1,
gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode, basereg + cum->words + offset),
const0_rtx)));
else
return gen_rtx_REG (mode, basereg + cum->words + offset);
2000-03-09 01:26:04 +01:00
}
/* If there is no prototype, then FP values go in both FR and GR
registers. */
else
{
/* See comment above. */
enum machine_mode inner_mode =
(BYTES_BIG_ENDIAN && mode == SFmode) ? DImode : mode;
2000-03-09 01:26:04 +01:00
rtx fp_reg = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (mode, (FR_ARG_FIRST
+ cum->fp_regs)),
const0_rtx);
rtx gr_reg = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (inner_mode,
2000-03-09 01:26:04 +01:00
(basereg + cum->words
+ offset)),
const0_rtx);
2000-03-09 01:26:04 +01:00
return gen_rtx_PARALLEL (mode, gen_rtvec (2, fp_reg, gr_reg));
}
}
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
/* Return number of bytes, at the beginning of the argument, that must be
2000-03-09 01:26:04 +01:00
put in registers. 0 is the argument is entirely in registers or entirely
in memory. */
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
static int
ia64_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, bool named ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
int words = ia64_function_arg_words (type, mode);
int offset = ia64_function_arg_offset (cum, type, words);
2000-03-09 01:26:04 +01:00
/* If all argument slots are used, then it must go on the stack. */
if (cum->words + offset >= MAX_ARGUMENT_SLOTS)
return 0;
/* It doesn't matter whether the argument goes in FR or GR regs. If
it fits within the 8 argument slots, then it goes entirely in
registers. If it extends past the last argument slot, then the rest
goes on the stack. */
if (words + cum->words + offset <= MAX_ARGUMENT_SLOTS)
return 0;
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
return (MAX_ARGUMENT_SLOTS - cum->words - offset) * UNITS_PER_WORD;
2000-03-09 01:26:04 +01:00
}
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* Return ivms_arg_type based on machine_mode. */
static enum ivms_arg_type
ia64_arg_type (enum machine_mode mode)
{
switch (mode)
{
case SFmode:
return FS;
case DFmode:
return FT;
default:
return I64;
}
}
2000-03-09 01:26:04 +01:00
/* Update CUM to point after this argument. This is patterned after
ia64_function_arg. */
void
ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int named)
2000-03-09 01:26:04 +01:00
{
int words = ia64_function_arg_words (type, mode);
int offset = ia64_function_arg_offset (cum, type, words);
2000-03-09 01:26:04 +01:00
enum machine_mode hfa_mode = VOIDmode;
/* If all arg slots are already full, then there is nothing to do. */
if (cum->words >= MAX_ARGUMENT_SLOTS)
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
{
cum->words += words + offset;
return;
}
2000-03-09 01:26:04 +01:00
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
cum->atypes[cum->words] = ia64_arg_type (mode);
2000-03-09 01:26:04 +01:00
cum->words += words + offset;
/* Check for and handle homogeneous FP aggregates. */
if (type)
hfa_mode = hfa_element_mode (type, 0);
/* Unnamed prototyped hfas are passed as usual. Named prototyped hfas
and unprototyped hfas are passed specially. */
if (hfa_mode != VOIDmode && (! cum->prototype || named))
{
int fp_regs = cum->fp_regs;
/* This is the original value of cum->words + offset. */
int int_regs = cum->words - words;
int hfa_size = GET_MODE_SIZE (hfa_mode);
int byte_size;
int args_byte_size;
/* If prototyped, pass it in FR regs then GR regs.
If not prototyped, pass it in both FR and GR regs.
If this is an SFmode aggregate, then it is possible to run out of
FR regs while GR regs are still left. In that case, we pass the
remaining part in the GR regs. */
/* Fill the FP regs. We do this always. We stop if we reach the end
of the argument, the last FP register, or the last argument slot. */
byte_size = ((mode == BLKmode)
? int_size_in_bytes (type) : GET_MODE_SIZE (mode));
args_byte_size = int_regs * UNITS_PER_WORD;
offset = 0;
for (; (offset < byte_size && fp_regs < MAX_ARGUMENT_SLOTS
&& args_byte_size < (MAX_ARGUMENT_SLOTS * UNITS_PER_WORD));)
{
offset += hfa_size;
args_byte_size += hfa_size;
fp_regs++;
}
cum->fp_regs = fp_regs;
}
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* On OpenVMS variable argument is either in Rn or Fn. */
else if (TARGET_ABI_OPEN_VMS && named == 0)
{
cum->int_regs = cum->words;
cum->fp_regs = cum->words;
}
/* Integral and aggregates go in general registers. So do TFmode FP values.
If we have run out of FR registers, then other FP values must also go in
general registers. This can happen when we have a SFmode HFA. */
else if (mode == TFmode || mode == TCmode
|| (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS))
cum->int_regs = cum->words;
2000-03-09 01:26:04 +01:00
/* If there is a prototype, then FP values go in a FR register when
named, and in a GR register when unnamed. */
2000-03-09 01:26:04 +01:00
else if (cum->prototype)
{
if (! named)
cum->int_regs = cum->words;
2000-03-09 01:26:04 +01:00
else
/* ??? Complex types should not reach here. */
cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
}
/* If there is no prototype, then FP values go in both FR and GR
registers. */
else
{
/* ??? Complex types should not reach here. */
cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
cum->int_regs = cum->words;
}
2000-03-09 01:26:04 +01:00
}
/* Arguments with alignment larger than 8 bytes start at the next even
boundary. On ILP32 HPUX, TFmode arguments start on next even boundary
even though their normal alignment is 8 bytes. See ia64_function_arg. */
int
ia64_function_arg_boundary (enum machine_mode mode, tree type)
{
if (mode == TFmode && TARGET_HPUX && TARGET_ILP32)
return PARM_BOUNDARY * 2;
if (type)
{
if (TYPE_ALIGN (type) > PARM_BOUNDARY)
return PARM_BOUNDARY * 2;
else
return PARM_BOUNDARY;
}
if (GET_MODE_BITSIZE (mode) > PARM_BOUNDARY)
return PARM_BOUNDARY * 2;
else
return PARM_BOUNDARY;
}
/* True if it is OK to do sibling call optimization for the specified
call expression EXP. DECL will be the called function, or NULL if
this is an indirect call. */
static bool
ia64_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
/* We can't perform a sibcall if the current function has the syscall_linkage
attribute. */
if (lookup_attribute ("syscall_linkage",
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
return false;
/* We must always return with our current GP. This means we can
only sibcall to functions defined in the current module unless
TARGET_CONST_GP is set to true. */
return (decl && (*targetm.binds_local_p) (decl)) || TARGET_CONST_GP;
}
2000-03-09 01:26:04 +01:00
/* Implement va_arg. */
static tree
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
ia64_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
gimple_seq *post_p)
{
/* Variable sized types are passed by reference. */
if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
{
tree ptrtype = build_pointer_type (type);
tree addr = std_gimplify_va_arg_expr (valist, ptrtype, pre_p, post_p);
return build_va_arg_indirect_ref (addr);
}
/* Aggregate arguments with alignment larger than 8 bytes start at
the next even boundary. Integer and floating point arguments
do so if they are larger than 8 bytes, whether or not they are
also aligned larger than 8 bytes. */
if ((TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == INTEGER_TYPE)
? int_size_in_bytes (type) > 8 : TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
{
[multiple changes] 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-16 07:42:36 +02:00
tree t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (valist), valist,
size_int (2 * UNITS_PER_WORD - 1));
t = fold_convert (sizetype, t);
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
[multiple changes] 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-16 07:42:36 +02:00
size_int (-2 * UNITS_PER_WORD));
t = fold_convert (TREE_TYPE (valist), t);
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimplify_assign (unshare_expr (valist), t, pre_p);
}
return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
}
2000-03-09 01:26:04 +01:00
/* Return 1 if function return value returned in memory. Return 0 if it is
in a register. */
static bool
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
ia64_return_in_memory (const_tree valtype, const_tree fntype ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
enum machine_mode mode;
enum machine_mode hfa_mode;
HOST_WIDE_INT byte_size;
2000-03-09 01:26:04 +01:00
mode = TYPE_MODE (valtype);
byte_size = GET_MODE_SIZE (mode);
if (mode == BLKmode)
{
byte_size = int_size_in_bytes (valtype);
if (byte_size < 0)
return true;
}
2000-03-09 01:26:04 +01:00
/* Hfa's with up to 8 elements are returned in the FP argument registers. */
hfa_mode = hfa_element_mode (valtype, 0);
if (hfa_mode != VOIDmode)
{
int hfa_size = GET_MODE_SIZE (hfa_mode);
if (byte_size / hfa_size > MAX_ARGUMENT_SLOTS)
return true;
2000-03-09 01:26:04 +01:00
else
return false;
2000-03-09 01:26:04 +01:00
}
else if (byte_size > UNITS_PER_WORD * MAX_INT_RETURN_SLOTS)
return true;
2000-03-09 01:26:04 +01:00
else
return false;
2000-03-09 01:26:04 +01:00
}
/* Return rtx for register that holds the function return value. */
rtx
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
ia64_function_value (const_tree valtype, const_tree func)
2000-03-09 01:26:04 +01:00
{
enum machine_mode mode;
enum machine_mode hfa_mode;
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
int unsignedp;
2000-03-09 01:26:04 +01:00
mode = TYPE_MODE (valtype);
hfa_mode = hfa_element_mode (valtype, 0);
if (hfa_mode != VOIDmode)
{
rtx loc[8];
int i;
int hfa_size;
int byte_size;
int offset;
hfa_size = GET_MODE_SIZE (hfa_mode);
byte_size = ((mode == BLKmode)
? int_size_in_bytes (valtype) : GET_MODE_SIZE (mode));
offset = 0;
for (i = 0; offset < byte_size; i++)
{
loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (hfa_mode, FR_ARG_FIRST + i),
GEN_INT (offset));
offset += hfa_size;
}
return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
2000-03-09 01:26:04 +01:00
}
else if (FLOAT_TYPE_P (valtype) && mode != TFmode && mode != TCmode)
2000-03-09 01:26:04 +01:00
return gen_rtx_REG (mode, FR_ARG_FIRST);
else
{
bool need_parallel = false;
/* In big-endian mode, we need to manage the layout of aggregates
in the registers so that we get the bits properly aligned in
the highpart of the registers. */
if (BYTES_BIG_ENDIAN
&& (mode == BLKmode || (valtype && AGGREGATE_TYPE_P (valtype))))
need_parallel = true;
/* Something like struct S { long double x; char a[0] } is not an
HFA structure, and therefore doesn't go in fp registers. But
the middle-end will give it XFmode anyway, and XFmode values
don't normally fit in integer registers. So we need to smuggle
the value inside a parallel. */
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
else if (mode == XFmode || mode == XCmode || mode == RFmode)
need_parallel = true;
if (need_parallel)
{
rtx loc[8];
int offset;
int bytesize;
int i;
offset = 0;
bytesize = int_size_in_bytes (valtype);
/* An empty PARALLEL is invalid here, but the return value
doesn't matter for empty structs. */
if (bytesize == 0)
return gen_rtx_REG (mode, GR_RET_FIRST);
for (i = 0; offset < bytesize; i++)
{
loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode,
GR_RET_FIRST + i),
GEN_INT (offset));
offset += UNITS_PER_WORD;
}
return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
}
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
mode = ia64_promote_function_mode (valtype, mode, &unsignedp,
func ? TREE_TYPE (func) : NULL_TREE,
true);
return gen_rtx_REG (mode, GR_RET_FIRST);
}
2000-03-09 01:26:04 +01:00
}
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL.
We need to emit DTP-relative relocations. */
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
static void
ia64_output_dwarf_dtprel (FILE *file, int size, rtx x)
{
gcc_assert (size == 4 || size == 8);
if (size == 4)
fputs ("\tdata4.ua\t@dtprel(", file);
else
fputs ("\tdata8.ua\t@dtprel(", file);
output_addr_const (file, x);
fputs (")", file);
}
2000-03-09 01:26:04 +01:00
/* Print a memory address as an operand to reference that memory location. */
/* ??? Do we need this? It gets used only for 'a' operands. We could perhaps
also call this from ia64_print_operand for memory addresses. */
void
ia64_print_operand_address (FILE * stream ATTRIBUTE_UNUSED,
rtx address ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
}
/* Print an operand to an assembler instruction.
2000-03-09 01:26:04 +01:00
C Swap and print a comparison operator.
D Print an FP comparison operator.
E Print 32 - constant, for SImode shifts as extract.
e Print 64 - constant, for DImode rotates.
2000-03-09 01:26:04 +01:00
F A floating point constant 0.0 emitted as f0, or 1.0 emitted as f1, or
a floating point register emitted normally.
G A floating point constant.
2000-03-09 01:26:04 +01:00
I Invert a predicate register by adding 1.
J Select the proper predicate register for a condition.
j Select the inverse predicate register for a condition.
2000-03-09 01:26:04 +01:00
O Append .acq for volatile load.
P Postincrement of a MEM.
Q Append .rel for volatile store.
R Print .s .d or nothing for a single, double or no truncation.
2000-03-09 01:26:04 +01:00
S Shift amount for shladd instruction.
T Print an 8-bit sign extended number (K) as a 32-bit unsigned number
for Intel assembler.
U Print an 8-bit sign extended number (K) as a 64-bit unsigned number
for Intel assembler.
X A pair of floating point registers.
2000-03-09 01:26:04 +01:00
r Print register name, or constant 0 as r0. HP compatibility for
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
Linux kernel.
v Print vector constant value as an 8-byte integer value. */
2000-03-09 01:26:04 +01:00
void
ia64_print_operand (FILE * file, rtx x, int code)
2000-03-09 01:26:04 +01:00
{
const char *str;
2000-03-09 01:26:04 +01:00
switch (code)
{
case 0:
/* Handled below. */
break;
2000-03-09 01:26:04 +01:00
case 'C':
{
enum rtx_code c = swap_condition (GET_CODE (x));
fputs (GET_RTX_NAME (c), file);
return;
}
case 'D':
switch (GET_CODE (x))
{
case NE:
str = "neq";
break;
case UNORDERED:
str = "unord";
break;
case ORDERED:
str = "ord";
break;
case UNLT:
str = "nge";
break;
case UNLE:
str = "ngt";
break;
case UNGT:
str = "nle";
break;
case UNGE:
str = "nlt";
break;
default:
str = GET_RTX_NAME (GET_CODE (x));
break;
}
fputs (str, file);
2000-03-09 01:26:04 +01:00
return;
case 'E':
fprintf (file, HOST_WIDE_INT_PRINT_DEC, 32 - INTVAL (x));
return;
case 'e':
fprintf (file, HOST_WIDE_INT_PRINT_DEC, 64 - INTVAL (x));
return;
2000-03-09 01:26:04 +01:00
case 'F':
if (x == CONST0_RTX (GET_MODE (x)))
str = reg_names [FR_REG (0)];
2000-03-09 01:26:04 +01:00
else if (x == CONST1_RTX (GET_MODE (x)))
str = reg_names [FR_REG (1)];
2000-03-09 01:26:04 +01:00
else
{
gcc_assert (GET_CODE (x) == REG);
str = reg_names [REGNO (x)];
}
fputs (str, file);
2000-03-09 01:26:04 +01:00
return;
case 'G':
{
long val[4];
REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
real_to_target (val, &rv, GET_MODE (x));
if (GET_MODE (x) == SFmode)
fprintf (file, "0x%08lx", val[0] & 0xffffffff);
else if (GET_MODE (x) == DFmode)
fprintf (file, "0x%08lx%08lx", (WORDS_BIG_ENDIAN ? val[0] : val[1])
& 0xffffffff,
(WORDS_BIG_ENDIAN ? val[1] : val[0])
& 0xffffffff);
else
output_operand_lossage ("invalid %%G mode");
}
return;
2000-03-09 01:26:04 +01:00
case 'I':
fputs (reg_names [REGNO (x) + 1], file);
return;
case 'J':
case 'j':
{
unsigned int regno = REGNO (XEXP (x, 0));
if (GET_CODE (x) == EQ)
regno += 1;
if (code == 'j')
regno ^= 1;
fputs (reg_names [regno], file);
}
return;
2000-03-09 01:26:04 +01:00
case 'O':
if (MEM_VOLATILE_P (x))
fputs(".acq", file);
return;
case 'P':
{
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
HOST_WIDE_INT value;
2000-03-09 01:26:04 +01:00
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
switch (GET_CODE (XEXP (x, 0)))
{
default:
return;
case POST_MODIFY:
x = XEXP (XEXP (XEXP (x, 0), 1), 1);
if (GET_CODE (x) == CONST_INT)
value = INTVAL (x);
else
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
{
gcc_assert (GET_CODE (x) == REG);
fprintf (file, ", %s", reg_names[REGNO (x)]);
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
return;
}
break;
2000-03-09 01:26:04 +01:00
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
case POST_INC:
value = GET_MODE_SIZE (GET_MODE (x));
break;
2000-03-09 01:26:04 +01:00
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
case POST_DEC:
value = - (HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (x));
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
break;
}
fprintf (file, ", " HOST_WIDE_INT_PRINT_DEC, value);
2000-03-09 01:26:04 +01:00
return;
}
case 'Q':
if (MEM_VOLATILE_P (x))
fputs(".rel", file);
return;
case 'R':
if (x == CONST0_RTX (GET_MODE (x)))
fputs(".s", file);
else if (x == CONST1_RTX (GET_MODE (x)))
fputs(".d", file);
else if (x == CONST2_RTX (GET_MODE (x)))
;
else
output_operand_lossage ("invalid %%R value");
return;
2000-03-09 01:26:04 +01:00
case 'S':
fprintf (file, "%d", exact_log2 (INTVAL (x)));
2000-03-09 01:26:04 +01:00
return;
case 'T':
if (! TARGET_GNU_AS && GET_CODE (x) == CONST_INT)
{
fprintf (file, "0x%x", (int) INTVAL (x) & 0xffffffff);
2000-03-09 01:26:04 +01:00
return;
}
break;
case 'U':
if (! TARGET_GNU_AS && GET_CODE (x) == CONST_INT)
{
const char *prefix = "0x";
2000-03-09 01:26:04 +01:00
if (INTVAL (x) & 0x80000000)
{
fprintf (file, "0xffffffff");
prefix = "";
}
fprintf (file, "%s%x", prefix, (int) INTVAL (x) & 0xffffffff);
2000-03-09 01:26:04 +01:00
return;
}
break;
case 'X':
{
unsigned int regno = REGNO (x);
fprintf (file, "%s, %s", reg_names [regno], reg_names [regno + 1]);
}
return;
2000-03-09 01:26:04 +01:00
case 'r':
/* If this operand is the constant zero, write it as register zero.
Any register, zero, or CONST_INT value is OK here. */
2000-03-09 01:26:04 +01:00
if (GET_CODE (x) == REG)
fputs (reg_names[REGNO (x)], file);
else if (x == CONST0_RTX (GET_MODE (x)))
fputs ("r0", file);
else if (GET_CODE (x) == CONST_INT)
output_addr_const (file, x);
2000-03-09 01:26:04 +01:00
else
output_operand_lossage ("invalid %%r value");
return;
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
case 'v':
gcc_assert (GET_CODE (x) == CONST_VECTOR);
x = simplify_subreg (DImode, x, GET_MODE (x), 0);
break;
case '+':
{
const char *which;
/* For conditional branches, returns or calls, substitute
sptk, dptk, dpnt, or spnt for %s. */
x = find_reg_note (current_output_insn, REG_BR_PROB, 0);
if (x)
{
int pred_val = INTVAL (XEXP (x, 0));
/* Guess top and bottom 10% statically predicted. */
if (pred_val < REG_BR_PROB_BASE / 50
&& br_prob_note_reliable_p (x))
which = ".spnt";
else if (pred_val < REG_BR_PROB_BASE / 2)
which = ".dpnt";
else if (pred_val < REG_BR_PROB_BASE / 100 * 98
|| !br_prob_note_reliable_p (x))
which = ".dptk";
else
which = ".sptk";
}
else if (GET_CODE (current_output_insn) == CALL_INSN)
which = ".sptk";
else
which = ".dptk";
fputs (which, file);
return;
}
case ',':
x = current_insn_predicate;
if (x)
{
unsigned int regno = REGNO (XEXP (x, 0));
if (GET_CODE (x) == EQ)
regno += 1;
fprintf (file, "(%s) ", reg_names [regno]);
}
return;
2000-03-09 01:26:04 +01:00
default:
output_operand_lossage ("ia64_print_operand: unknown code");
return;
}
switch (GET_CODE (x))
{
/* This happens for the spill/restore instructions. */
case POST_INC:
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
case POST_DEC:
case POST_MODIFY:
2000-03-09 01:26:04 +01:00
x = XEXP (x, 0);
/* ... fall through ... */
2000-03-09 01:26:04 +01:00
case REG:
fputs (reg_names [REGNO (x)], file);
break;
case MEM:
{
rtx addr = XEXP (x, 0);
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes... 2004-02-07 Paolo Bonzini <bonzini@gnu.org> * alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes, possibly splitting conditionals that tested against '<' and 'o'. * caller-save.c (save_call_clobbered_regs): Likewise. * combine.c (contains_muldiv, find_split_point, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, simplify_logical, expand_compound_operation, make_compound_operation, if_then_else_cond, known_cond, apply_distributive_law, cached_nonzero_bits, cached_num_sign_bit_copies, simplify_shift_const, gen_binary, simplify_comparison, update_table_tick, record_value_for_reg, get_lsat_value_validate): Likewise. * cse.c (mention_regs, find_best_addr, find_comparison_args, fold_rtx, cse_insn, invalidate_memory, cse_basic_block): Likewise. * emit-rtl.c (copy_insn_1): Likewise. * expr.c (force_operand): Likewise. * final.c (final_scan_insn, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond, and_reg_cond, elim_reg_cond): Likewise. * function.c (update_epilogue_consts): Likewise. * genattrtab.c (attr_rtx_1): Likewise. * genopinit.c (gen_insn): Likewise. * integrate.c (subst_constants): Likewise. * jump.c (reversed_comparison_code_parts, reversed_comparison_code, delete_related_insns, rtx_renumbered_equal_p): Likewise. * local-alloc.c (block_alloc): Likewise. * loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv, canonicalize_condition): Likewise. * loop-iv.c (simplify_using_conditions, iv_number_of_iterations): Likewise. * optabs.c (add_equal_node, expand_binop): Likewise. * predict.c (estimate_probability): Likewise. * ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise. * recog.c (validate_replace_rtx_1, comparison_operator, offsettable_address_p, constrain_operands): Likewise. * reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (stable_and_no_regs_but_for_p): Likewise. * regrename.c (kill_autoinc_value): Likewise. * reload.c (find_reusable_reload, find_reloads, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (gen_reload, delete_address_reloads_1): Likewise. * rtl.c (copy_rtx): Likewise. * rtl.h (CONSTANT_P, INSN_P): Likewise. * rtlanal.c (commutative_operand_precedence): Likewise. * sched-deps.c (conditions_mutex_p): Likewise. * sched-rgn.c (is_cfg_nonregular): Likewise. * simplify-rtx.c (simplify_gen_binary, simplify_gen_relational, simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_ternary_operation, simplify_rtx): Likewise. * unroll.c (reg_dead_after_loop): Likewise. * config/alpha/alpha.c (alpha_swapped_comparison_operator, print_operand): Likewise. * config/arc/arc.c (proper_comparison_operator): Likewise. * config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode): Likewise. * config/avr/avr.c (_reg_unused_after): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests, frv_ifcvt_modify_insn, frv_pack_insn): Likewise. * config/i386/i386.c (ix86_comparison_operator, ix86_carry_flag_operator, fcmov_comparison_operator, arith_or_logical_operator, print_operand, ix86_expand_binary_operator, ix86_binary_operator_ok): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (not_postinc_memory_operand, ia64_print_operand, update_set_flags, errata_emit_nops): Likewise. * config/ia64/ia64.h (PREFERRED_RELOAD_CLASS, CONSTRAINT_OK_FOR_S): Likewise. * config/ip2k/ip2k.c (mdr_resequence_xy_yx, mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p, ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator): Likewise. * config/iq2000/iq2000.c (cmp_op, symbolic_expression_p, eqne_comparison_operator, signed_comparison_operator): Likewise. * config/mips/mips.c (cmp_op, symbolic_expression_p): Likewise. * config/mmix/mmix (mmix_foldable_comparison_operator, mmix_comparison_operator): Likewise. * config/pa/pa.c (hppa_legitimize_address): Likewise. * config/rs6000/rs6000.c (stmw_operation, branch_comparison_operator, trap_comparison_operator, ccr_bit): Likewise. * config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise. * config/s390/s390.c (s390_alc_comparison, s390_slb_comparison):L Likewise. * config/sh/sh.c (gen_block_redirect, reg_unused_after): Likewise. * config/sparc/sparc.c (eq_or_neq, normal_comp_operator, noov_compare_op, noov_compare64_op, v9_regcmp_op, emit_hard_tfmode_operation, reg_unused_after) * doc/md.texi, doc/rtl.texi: Likewise. * ra-debug.c: Add 2004 to list of copyright years. * unroll.c: Likewise. * combine.c (simplify_logical): Remove dummy test, (apply_distributive_law): Fix typo in comment. GET_CODE (x) == AND so x is a commutative binary op. * jump.c (delete_related_insns): simplify loop condition, move testing of RTX codes inside the loop. (rtx_renumbered_equal_p): do not use RTX_CODE. * rtl.c (rtx_class): Declare as enum rtx_class. * rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED): Move to RTX_COMM_COMPARE class. (HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE): Move to RTX_CONST_OBJ class. * rtl.h (enum rtx_class): New declaration, (RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK, RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT, RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK, RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT, RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P, ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P, SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P, OBJECT_P): New macros. * config/sparc/sparc.c (noov_compare_op): Remove register from parameter. From-SVN: r78824
2004-03-03 09:35:33 +01:00
if (GET_RTX_CLASS (GET_CODE (addr)) == RTX_AUTOINC)
2000-03-09 01:26:04 +01:00
addr = XEXP (addr, 0);
fprintf (file, "[%s]", reg_names [REGNO (addr)]);
break;
}
2000-03-09 01:26:04 +01:00
default:
output_addr_const (file, x);
break;
}
return;
}
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
scanned. In either case, *TOTAL contains the cost result. */
/* ??? This is incomplete. */
static bool
fwprop.c (should_replace_address): Add speed attribute. * fwprop.c (should_replace_address): Add speed attribute. (PR_OPTIMIZE_FOR_SPEED): New flag. (propagate_rtx_1): Use it. (propagate_rtx): Set it. (try_fwprop_subst): Update call of rtx_costs. (forward_propagate_and_simplify): LIkewise. * hooks.c (hook_int_rtx_bool_0): New (hook_bool_rtx_int_int_intp_false): Replace by ... (hook_bool_rtx_int_int_intp_bool_false): .. thisone. * hooks.h (hook_int_rtx_bool_0): New (hook_bool_rtx_int_int_intp_false): Replace by ... (hook_bool_rtx_int_int_intp_bool_false): .. thisone. * optabs.c (avoid_expensive_constant): UPdate call of rtx_cost. (prepare_cmp_insn): UPdate call of rtx_cost. * postreload.c (reload_cse_simplify_set): Update call of rtx_cost. (reload_cse_simplify_operands): Update call of rtx_cost. (reload_cse_move2add): call of rtx_cost. * target.h (struct gcc_target): Update rtx_costs and address_costs. * rtlanal.c (rtx_cost): Add speed argument. (address_cost): Add speed argument (default_address_cost): Likewise. (insn_rtx_cost): Likewise. * cfgloopanal.c (seq_cost): Add speed argument. (target_reg_cost, target_spill_cost): Turn to array. (init_set_costs): Update for speed. (estimate_reg_pressure_cost): Add speed argument. * auto-inc-dec.c (attempt_change): Update call of rtx_cost. * dojump.c (prefer_and_bit_test): UPdate call of rtx_cost. * tree-ssa-loop-ivopts.c (struct ivopts_data): New field speed. (seq_cost): Add speed argument. (computation_cost): Add speed arugment. (add_cost, multiply_by_const, get_address_cost): add speed argument. (force_expr_to_var_cost): Update for profile info. (force_var_cost): Likewise. (split_address_cost): Likewise. (ptr_difference_cost): Likewise. (difference_cost): Likewise. (get_computation_cost_at): Likewise. (determine_iv_cost): Likewise. (ivopts_global_cost_for_size): Likewise. (rewrite_use_address): Likewise. (tree_ssa_iv_optimize_loop): Initialize speed field. * cse.c (optimize_this_for_speed_p): New static var. (notreg_cost): Update call of rtx_cost. (cse_extended_basic_block): set optimize_this_for_speed_p. * ifcvt.c (cheap_bb_rtx_cost_p): Update call of rtx_cost. (noce_try_cmove_arith): Likewise. (noce_try_sign_mask): LIkewise. * expr.c (compress_float_constant): Update rtx_cost calls. * tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument. (addr_to_parts): Likewise. (create_mem_ref): Likewise. * dse.c (find_shift_sequence): Add speed argument. (replace_read): Update call. * calls.c (precompute_register_parameters): Update call of rtx_cost. * expmed.c (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, * neg_cost, shift_cost, shiftadd_cost, shiftsub_cost, mul_cost, sdiv_cost, udiv_cost ,mul_widen_cost, mul_highpart_cost): Increase dimension. (init_expmed): Initialize for both size and speed. (expand_shift): Use profile. (synth_mult): Use profile. (choose_mult_variant): Use profile. (expand_mult): Use profile. (expand_mult_highpart_optab): Use profile. (expand_mult_highpart): Use profile. (expand_smod_pow2): Use profile. (expand_divmod): Use profile. * simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost. * loop-invariant.c (create_new_invariant): Use profile. (gain_for_invariant): Add speed parameter. (best_gain_for_invariant): Likewise. (find_invariants_to_move): Likewise. (move_single_loop_invariants): Set it. * target-def.h (TARGET_RTX_COSTS): Use hook. * rtl.h (rtx_cost, address_cost, insn_rtx_cost): Update prototpe. (optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare. * output.h (default_address_cost): Update prototype. * combine.c (optimize_this_for_speed_p): New static var. (combine_validate_cost): Update call of rtx_cost. (combine_instructions): Set optimize_this_for_speed_p. (expand_compound_operation): Update call of rtx_cost. (make_extraction):Update call of rtx_cost. (force_to_mode):Update call of rtx_cost. (distribute_and_simplify_rtx):Update call of rtx_cost. * cfgloop.h (target_reg_cost, target_spill_cost): Turn to array. (estimate_reg_pressure_cost): Update prototype. * tree-flow.h (multiply_by_cost, create_mem_ref): Update prototype. * basic-block.h (optimize_insn_for_size_p, optimize_insn_for_speed_p): Remove. * config/alpha/alpha.c (alpha_rtx_costs): Update. (alpha_rtx_costs): Update. * config/frv/frv.c (frv_rtx_costs): Update. * config/s390/s390.c (s390_rtx_costs): Update. * config/m32c/m32c.c (m32c_memory_move_cost): Update. (m32c_rtx_costs): Update. * config/spu/spu.c (TARGET_ADDRESS_COST): Upate. (spu_rtx_costs): Update. * config/sparc/sparc.c (sparc_rtx_costs): Update. * config/m32r/m32r.c (m32r_rtx_costs): Update. * config/i386/i386.c (:ix86_address_cost): Update. (ix86_rtx_costs): Update. * config/sh/sh.c (sh_rtx_costs, sh_address_cost): Update. * config/pdp11/pdp11.c (pdp11_rtx_costs): Update. * config/avr/avr.c (avr_rtx_costs, avr_address_cost): Update. * config/crx/crx.c (crx_address_cost): Update. * config/xtensa/xtensa.c (xtensa_rtx_costs): Update. * config/stormy16/stormy16.c (xstormy16_address_cost, xstormy16_rtx_costs): Update. * config/m68hc11/m68hc11.c (m68hc11_address_cost, m68hc11_rtx_costs): Update. * config/cris/cris.c (cris_rtx_costs, cris_address_cost): Update. * config/iq2000/iq2000.c (iq2000_rtx_costs, iq2000_address_cost): Update. * config/mn10300/mn10300.c (mn10300_address_cost, mn10300_rtx_costs): Update * config/ia64/ia64.c (ia64_rtx_costs): Update. * config/m68k/m68k.c (m68k_rtx_costs): Update. * config/rs6000/rs6000.c (rs6000_rtx_costs): Update. * config/arc/arc.c (arc_rtx_costs, arc_address_cost): Update. * config/mcore/mcore.c (TARGET_ADDRESS_COST): Update. (mcore_rtx_costs): update. * config/score/score3.c (score3_rtx_costs): Update. * config/score/score7.c (score7_rtx_costs): Update. * config/score/score3.h (score3_rtx_costs):Update. * config/score/score7.h (score7_rtx_costs): Update. * config/score/score.c (score_rtx_costs): Update. * config/arm/arm.c (arm_address_cost): Update. (arm_rtx_costs_1): Update. (arm_rtx_costs_1): Update. (arm_size_rtx_costs): Update. (arm_size_rtx_costs): Update. (arm_size_rtx_costs): Update. (arm_xscale_rtx_costs): Update. (arm_thumb_address_cost): Update. * config/pa/pa.c (hppa_address_cost): Update. * config/mips/mips.c (mips_rtx_costs): Update. * config/vax/vax.c (vax_address_cost): Update. * config/h8300/h8300.c (h8300_shift_costs): Update. (h8300_rtx_costs): Update. * config/v850/v850.c (TARGET_ADDRESS_COST): Update. (v850_rtx_costs): Update. * config/mmix/mmix.c (mmix_rtx_costs, mmix_rtx_costs): Update. * config/bfin/bfin.c (bfin_address_cost): Update. (bfin_rtx_costs): Update. * stmt.c (lshift_cheap_p): Update. From-SVN: r139821
2008-08-31 11:44:25 +02:00
ia64_rtx_costs (rtx x, int code, int outer_code, int *total,
bool speed ATTRIBUTE_UNUSED)
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
{
switch (code)
{
case CONST_INT:
switch (outer_code)
{
case SET:
*total = satisfies_constraint_J (x) ? 0 : COSTS_N_INSNS (1);
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
return true;
case PLUS:
if (satisfies_constraint_I (x))
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
*total = 0;
else if (satisfies_constraint_J (x))
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
*total = 1;
else
*total = COSTS_N_INSNS (1);
return true;
default:
if (satisfies_constraint_K (x) || satisfies_constraint_L (x))
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
*total = 0;
else
*total = COSTS_N_INSNS (1);
return true;
}
case CONST_DOUBLE:
*total = COSTS_N_INSNS (1);
return true;
case CONST:
case SYMBOL_REF:
case LABEL_REF:
*total = COSTS_N_INSNS (3);
return true;
case MULT:
/* For multiplies wider than HImode, we have to go to the FPU,
which normally involves copies. Plus there's the latency
of the multiply itself, and the latency of the instructions to
transfer integer regs to FP regs. */
/* ??? Check for FP mode. */
if (GET_MODE_SIZE (GET_MODE (x)) > 2)
*total = COSTS_N_INSNS (10);
else
*total = COSTS_N_INSNS (2);
return true;
case PLUS:
case MINUS:
case ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
*total = COSTS_N_INSNS (1);
return true;
case DIV:
case UDIV:
case MOD:
case UMOD:
/* We make divide expensive, so that divide-by-constant will be
optimized to a multiply. */
*total = COSTS_N_INSNS (60);
return true;
default:
return false;
}
}
/* Calculate the cost of moving data from a register in class FROM to
one in class TO, using MODE. */
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
int
ia64_register_move_cost (enum machine_mode mode, enum reg_class from,
enum reg_class to)
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
{
/* ADDL_REGS is the same as GR_REGS for movement purposes. */
if (to == ADDL_REGS)
to = GR_REGS;
if (from == ADDL_REGS)
from = GR_REGS;
/* All costs are symmetric, so reduce cases by putting the
lower number class as the destination. */
if (from < to)
{
enum reg_class tmp = to;
to = from, from = tmp;
}
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
/* Moving from FR<->GR in XFmode must be more expensive than 2,
so that we get secondary memory reloads. Between FR_REGS,
we have to make this at least as expensive as MEMORY_MOVE_COST
to avoid spectacularly poor register class preferencing. */
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
if (mode == XFmode || mode == RFmode)
{
if (to != GR_REGS || from != GR_REGS)
return MEMORY_MOVE_COST (mode, to, 0);
else
return 3;
}
switch (to)
{
case PR_REGS:
/* Moving between PR registers takes two insns. */
if (from == PR_REGS)
return 3;
/* Moving between PR and anything but GR is impossible. */
if (from != GR_REGS)
return MEMORY_MOVE_COST (mode, to, 0);
break;
case BR_REGS:
/* Moving between BR and anything but GR is impossible. */
if (from != GR_REGS && from != GR_AND_BR_REGS)
return MEMORY_MOVE_COST (mode, to, 0);
break;
case AR_I_REGS:
case AR_M_REGS:
/* Moving between AR and anything but GR is impossible. */
if (from != GR_REGS)
return MEMORY_MOVE_COST (mode, to, 0);
break;
case GR_REGS:
case FR_REGS:
case FP_REGS:
case GR_AND_FR_REGS:
case GR_AND_BR_REGS:
case ALL_REGS:
break;
default:
gcc_unreachable ();
}
configure.in (ia64-*): Set float_format for i386 long double. * configure.in (ia64-*): Set float_format for i386 long double. * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT as we would for i386 XFmode. (PUT_REAL): Likewise. (endian, ereal_atof, real_value_truncate): Likewise. (ereal_isneg, toe64, etens, make_nan): Likewise. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (general_tfmode_operand): New. (destination_tfmode_operand): New. (tfreg_or_fp01_operand): New. (ia64_split_timode): New. (spill_tfmode_operand): New. (ia64_expand_prologue): Use TFmode not XFmode. (ia64_expand_epilogue): Likewise. (ia64_function_arg): Likewise. (ia64_function_arg_advance): Likewise. (ia64_return_in_memory): Likewise. (ia64_function_value): Likewise. (ia64_print_operand): Likewise. (ia64_register_move_cost): Set GR<->FR to 5. (ia64_secondary_reload_class): Get GR for TImode memory op. * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. (ROUND_TYPE_ALIGN): Remove. (LONG_DOUBLE_TYPE_SIZE): Set to 128. (INTEL_EXTENDED_IEEE_FORMAT): Define. (HARD_REGNO_NREGS): Use TFmode, not XFmode. (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. (MODES_TIEABLE_P): Use TFmode, not XFmode. (CLASS_MAX_NREGS): Likewise. (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movti): New. (movti_internal): Use a clobber for memory alternatives. (reload_inti, reload_outti): New. (movsfcc_astep): Predicate properly. (movdfcc_astep): Likewise. (movxf): Remove. (movtf): New. (extendsftf2, extenddftf2): New. (trunctfsf2, trunctfdf2): New. (floatditf2, fix_trunctfdi2): New. (floatunsditf2, fixuns_trunctfdi2): New. (addtf3, subtf3, multf3, abstf2): New. (negtf2, nabstf2, mintf3, maxtf3): New. (maddtf3, msubtf3, nmultf3, nmaddtf3): New. (cmptf): New. (fr_spill): Use TFmode, not XFmode. (fr_restore): Likewise. * config/ia64/lib1funcs.asm (__divtf3): New. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. From-SVN: r35689
2000-08-14 23:01:24 +02:00
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
return 2;
}
2000-03-09 01:26:04 +01:00
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
/* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on RCLASS
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
to use when copying X into that class. */
enum reg_class
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
ia64_preferred_reload_class (rtx x, enum reg_class rclass)
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
{
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
switch (rclass)
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
{
case FR_REGS:
case FP_REGS:
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
/* Don't allow volatile mem reloads into floating point registers.
This is defined to force reload to choose the r/m case instead
of the f/f case when reloading (set (reg fX) (mem/v)). */
if (MEM_P (x) && MEM_VOLATILE_P (x))
return NO_REGS;
/* Force all unrecognized constants into the constant pool. */
if (CONSTANT_P (x))
return NO_REGS;
break;
case AR_M_REGS:
case AR_I_REGS:
if (!OBJECT_P (x))
return NO_REGS;
break;
default:
break;
}
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
return rclass;
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
}
2000-03-09 01:26:04 +01:00
/* This function returns the register class required for a secondary
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
register when copying between one of the registers in RCLASS, and X,
2000-03-09 01:26:04 +01:00
using MODE. A return value of NO_REGS means that no secondary register
is required. */
enum reg_class
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
ia64_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
2000-03-09 01:26:04 +01:00
{
int regno = -1;
if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
regno = true_regnum (x);
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
switch (rclass)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
case BR_REGS:
case AR_M_REGS:
case AR_I_REGS:
/* ??? BR<->BR register copies can happen due to a bad gcse/cse/global
interaction. We end up with two pseudos with overlapping lifetimes
both of which are equiv to the same constant, and both which need
to be in BR_REGS. This seems to be a cse bug. cse_basic_block_end
changes depending on the path length, which means the qty_first_reg
check in make_regs_eqv can give different answers at different times.
At some point I'll probably need a reload_indi pattern to handle
this.
We can also get GR_AND_FR_REGS to BR_REGS/AR_REGS copies, where we
wound up with a FP register from GR_AND_FR_REGS. Extend that to all
non-general registers for good measure. */
if (regno >= 0 && ! GENERAL_REGNO_P (regno))
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return GR_REGS;
/* This is needed if a pseudo used as a call_operand gets spilled to a
stack slot. */
if (GET_CODE (x) == MEM)
return GR_REGS;
break;
case FR_REGS:
case FP_REGS:
/* Need to go through general registers to get to other class regs. */
if (regno >= 0 && ! (FR_REGNO_P (regno) || GENERAL_REGNO_P (regno)))
return GR_REGS;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* This can happen when a paradoxical subreg is an operand to the
muldi3 pattern. */
/* ??? This shouldn't be necessary after instruction scheduling is
enabled, because paradoxical subregs are not accepted by
register_operand when INSN_SCHEDULING is defined. Or alternatively,
stop the paradoxical subreg stupidity in the *_operand functions
in recog.c. */
if (GET_CODE (x) == MEM
&& (GET_MODE (x) == SImode || GET_MODE (x) == HImode
|| GET_MODE (x) == QImode))
return GR_REGS;
/* This can happen because of the ior/and/etc patterns that accept FP
registers as operands. If the third operand is a constant, then it
needs to be reloaded into a FP register. */
if (GET_CODE (x) == CONST_INT)
return GR_REGS;
/* This can happen because of register elimination in a muldi3 insn.
E.g. `26107 * (unsigned long)&u'. */
if (GET_CODE (x) == PLUS)
return GR_REGS;
break;
case PR_REGS:
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
/* ??? This happens if we cse/gcse a BImode value across a call,
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
and the function has a nonlocal goto. This is because global
does not allocate call crossing pseudos to hard registers when
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
crtl->has_nonlocal_goto is true. This is relatively
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
common for C++ programs that use exceptions. To reproduce,
return NO_REGS and compile libstdc++. */
if (GET_CODE (x) == MEM)
return GR_REGS;
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
/* This can happen when we take a BImode subreg of a DImode value,
and that DImode value winds up in some non-GR register. */
if (regno >= 0 && ! GENERAL_REGNO_P (regno) && ! PR_REGNO_P (regno))
return GR_REGS;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
break;
default:
break;
}
2000-03-09 01:26:04 +01:00
return NO_REGS;
}
/* Implement targetm.unspec_may_trap_p hook. */
static int
ia64_unspec_may_trap_p (const_rtx x, unsigned flags)
{
if (GET_CODE (x) == UNSPEC)
{
switch (XINT (x, 1))
{
case UNSPEC_LDA:
case UNSPEC_LDS:
case UNSPEC_LDSA:
case UNSPEC_LDCCLR:
case UNSPEC_CHKACLR:
case UNSPEC_CHKS:
/* These unspecs are just wrappers. */
return may_trap_p_1 (XVECEXP (x, 0, 0), flags);
}
}
return default_unspec_may_trap_p (x, flags);
}
2000-03-09 01:26:04 +01:00
/* Parse the -mfixed-range= option string. */
static void
fix_range (const char *const_str)
2000-03-09 01:26:04 +01:00
{
int i, first, last;
char *str, *dash, *comma;
2000-03-09 01:26:04 +01:00
/* str must be of the form REG1'-'REG2{,REG1'-'REG} where REG1 and
REG2 are either register names or register numbers. The effect
of this option is to mark the registers in the range from REG1 to
REG2 as ``fixed'' so they won't be used by the compiler. This is
used, e.g., to ensure that kernel mode code doesn't use f32-f127. */
i = strlen (const_str);
str = (char *) alloca (i + 1);
memcpy (str, const_str, i + 1);
2000-03-09 01:26:04 +01:00
while (1)
{
dash = strchr (str, '-');
if (!dash)
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "value of -mfixed-range must have form REG1-REG2");
2000-03-09 01:26:04 +01:00
return;
}
*dash = '\0';
comma = strchr (dash + 1, ',');
if (comma)
*comma = '\0';
first = decode_reg_name (str);
if (first < 0)
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "unknown register name: %s", str);
2000-03-09 01:26:04 +01:00
return;
}
last = decode_reg_name (dash + 1);
if (last < 0)
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "unknown register name: %s", dash + 1);
2000-03-09 01:26:04 +01:00
return;
}
*dash = '-';
if (first > last)
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "%s-%s is an empty range", str, dash + 1);
2000-03-09 01:26:04 +01:00
return;
}
for (i = first; i <= last; ++i)
fixed_regs[i] = call_used_regs[i] = 1;
if (!comma)
break;
*comma = ',';
str = comma + 1;
}
}
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
/* Implement TARGET_HANDLE_OPTION. */
static bool
opt-functions.awk (var_type): New function. * opt-functions.awk (var_type): New function. (var_set): Use CLVC_STRING if var_type returns "const char *". * opth-gen.awk: Use var_type to find out the types of variables. Don't print comments above each "extern" definition. * optc-gen.awk: Use var_type in the same way. * opts.h (cl_var_cond): Rename to... (cl_var_type): ...this. Add CLVC_STRING. (cl_option): Make "flag_var" a "void *" pointer. Replace "var_cond" with "var_type". * opts.c (handle_option, option_enabled): Update after above name change. Cast flag_var before using it. Handle CLVC_STRING. * config/alpha/alpha.h (alpha_tls_size): Delete. * config/alpha/alpha.c (alpha_tls_size, alpha_cpu_string) (alpha_tune_string, alpha_tp_string, alpha_fprm_string) (alpha_fptm_string, alpha_mlat_string): Delete. (alpha_handle_option): Don't set the above variables here. Use the integer argument to check the validity of -mtls-size=. * config/alpha/alpha.opt (mcpu=, mtune=, mfp-rounding-mode=) (mfp-trap-mode=, mtrap-precision=, mmemory-latency=): Add Var()s. (mtls-size=): Likewise. Convert to a UInteger and initialize the variable to 32. * config/arc/arc.c (arc_cpu_string, arc_text_string) (arc_data_string, arc_rodata_string): Delete. (arc_handle_option): Don't set the above variables here. * config/arc/arc.opt (mcpu=, mtext=, mdata=, mrodata=): Add Var()s and initialize them. * config/arm/arm.c (target_fpu_name, target_fpe_name) (target_float_abi_name, target_abi_name, structure_size_string) (arm_pic_register_string): Delete. (arm_handle_option): Don't set the above variables here, except in the handling of -mhard-float and -msoft-float. * config/arm/arm.opt (mabi=, mfloat-abi=, mfp=, mfpe=, mfpu=) (mpic-register=, mstructure-size-boundary=): Add Var()s. * config/avr/avr.c (avr_init_stack, avr_mcu_name, TARGET_HANDLE_OPTION) (avr_handle_option): Delete. * config/avr/avr.opt (mmcu=, minit-stack=): Add Var()s and initialize them. * config/bfin/bfin.c (bfin_library_id): Delete. (bfin_handle_option): Don't set it. * config/bfin/bfin.opt (mshared-library-id=): Add Var(). * config/c4x/c4x.h (c4x_rpts_cycles): Delete. * config/c4x/c4x.c (c4x_rpts_cycles): Delete. (c4x_handle_option): Don't set c4x_rpts_cycles here. * config/c4x/c4x.opt (mrpts=): Add Var(). * config/cris/aout.h (CRIS_SUBTARGET_HANDLE_OPTION): Don't set cris_elinux_stacksize_str here. * config/cris/aout.opt (melinux-stacksize=): Add Var(). * config/cris/cris.h (cris_max_stackframe_str, cris_cpu_str) (cris_tune_str, cris_elinux_stacksize_str): Delete. * config/cris/cris.c (cris_max_stackframe_str, cris_cpu_str) (cris_tune_str, cris_elinux_stacksize_str): Delete. (cris_handle_option): Don't set the above variables here. * config/cris/cris.opt (mcpu=, march=, mtune=, mmax-stackframe=) (max-stackframe=): Add Var()s. * config/i386/i386.h (ix86_tune_string, ix86_arch_string): Delete. * config/i386/i386.c (ix86_cmodel_string, ix86_asm_string) (ix86_tls_dialect_string, ix86_tune_string, ix86_arch_string) (ix86_fpmath_string, ix86_regparm_string, ix86_align_loops_string) (ix86_align_jumps_string, ix86_preferred_stack_boundary_string) (ix86_branch_cost_string, ix86_align_funcs_string): Delete. (ix86_handle_option): Don't set the above variables here. * config/i386/i386.opt (malign-functions=, malign-jumps=) (malign-loops=, march=, masm=, mbranch-cost=, mcmodel=, mfpmath=) (mpreferred-stack-boundary=, mregparm=, mtls-dialect=, mtune=): Add Var()s. * config/ia64/ia64.h (ia64_tls_size): Delete. * config/ia64/ia64.c (ia64_tls_size): Delete. (ia64_handle_option): Treat -mtls-size= as a UInteger option, reading the integer argument from the "value" parameter. Don't set ia64_tls_size here. * config/ia64/ia64.opt (mtls-size=): Turn into a UInteger option. Add Var() and Init(). * config/m32r/m32r.h (m32r_cache_flush_func): Delete. (m32r_cache_flush_trap): Delete. * config/m32r/m32r.c (m32r_cache_flush_func): Delete. (m32r_cache_flush_trap): Delete. (m32r_handle_option): Don't set the above variables when handling -mflush-func= and -mflush-trap=. * config/m32r/m32r.opt (-mflush-func=, -mflush-trap=): Add Var()s and Init()s. * config/mips/mips.h (mips_cache_flush_func): Delete. * config/mips/mips.c (mips_arch_string, mips_tune_string) (mips_cache_flush_func): Delete. (mips_handle_option): Don't set the above variables when handling -march=, -mtune= and -mflush-func=. * config/mips/mips.opt (march=, mflush-func=, mtune=): Add Var()s. * config/s390/s390.c (s390_arch_string): Delete. (s390_handle_option): Don't set it here. * config/s390/s390.opt (march=): Add Var(). * config/sparc/sparc.h (sparc_cmodel_string): Delete. * config/sparc/sparc.c (sparc_cmodel_string): Delete. (sparc_handle_option): Don't set it here. * config/sparc/sparc.opt (mcmodel=): Add Var(). From-SVN: r100185
2005-05-26 07:28:04 +02:00
ia64_handle_option (size_t code, const char *arg, int value)
{
static bool warned_itanium1_deprecated;
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
switch (code)
{
case OPT_mfixed_range_:
fix_range (arg);
return true;
case OPT_mtls_size_:
opt-functions.awk (var_type): New function. * opt-functions.awk (var_type): New function. (var_set): Use CLVC_STRING if var_type returns "const char *". * opth-gen.awk: Use var_type to find out the types of variables. Don't print comments above each "extern" definition. * optc-gen.awk: Use var_type in the same way. * opts.h (cl_var_cond): Rename to... (cl_var_type): ...this. Add CLVC_STRING. (cl_option): Make "flag_var" a "void *" pointer. Replace "var_cond" with "var_type". * opts.c (handle_option, option_enabled): Update after above name change. Cast flag_var before using it. Handle CLVC_STRING. * config/alpha/alpha.h (alpha_tls_size): Delete. * config/alpha/alpha.c (alpha_tls_size, alpha_cpu_string) (alpha_tune_string, alpha_tp_string, alpha_fprm_string) (alpha_fptm_string, alpha_mlat_string): Delete. (alpha_handle_option): Don't set the above variables here. Use the integer argument to check the validity of -mtls-size=. * config/alpha/alpha.opt (mcpu=, mtune=, mfp-rounding-mode=) (mfp-trap-mode=, mtrap-precision=, mmemory-latency=): Add Var()s. (mtls-size=): Likewise. Convert to a UInteger and initialize the variable to 32. * config/arc/arc.c (arc_cpu_string, arc_text_string) (arc_data_string, arc_rodata_string): Delete. (arc_handle_option): Don't set the above variables here. * config/arc/arc.opt (mcpu=, mtext=, mdata=, mrodata=): Add Var()s and initialize them. * config/arm/arm.c (target_fpu_name, target_fpe_name) (target_float_abi_name, target_abi_name, structure_size_string) (arm_pic_register_string): Delete. (arm_handle_option): Don't set the above variables here, except in the handling of -mhard-float and -msoft-float. * config/arm/arm.opt (mabi=, mfloat-abi=, mfp=, mfpe=, mfpu=) (mpic-register=, mstructure-size-boundary=): Add Var()s. * config/avr/avr.c (avr_init_stack, avr_mcu_name, TARGET_HANDLE_OPTION) (avr_handle_option): Delete. * config/avr/avr.opt (mmcu=, minit-stack=): Add Var()s and initialize them. * config/bfin/bfin.c (bfin_library_id): Delete. (bfin_handle_option): Don't set it. * config/bfin/bfin.opt (mshared-library-id=): Add Var(). * config/c4x/c4x.h (c4x_rpts_cycles): Delete. * config/c4x/c4x.c (c4x_rpts_cycles): Delete. (c4x_handle_option): Don't set c4x_rpts_cycles here. * config/c4x/c4x.opt (mrpts=): Add Var(). * config/cris/aout.h (CRIS_SUBTARGET_HANDLE_OPTION): Don't set cris_elinux_stacksize_str here. * config/cris/aout.opt (melinux-stacksize=): Add Var(). * config/cris/cris.h (cris_max_stackframe_str, cris_cpu_str) (cris_tune_str, cris_elinux_stacksize_str): Delete. * config/cris/cris.c (cris_max_stackframe_str, cris_cpu_str) (cris_tune_str, cris_elinux_stacksize_str): Delete. (cris_handle_option): Don't set the above variables here. * config/cris/cris.opt (mcpu=, march=, mtune=, mmax-stackframe=) (max-stackframe=): Add Var()s. * config/i386/i386.h (ix86_tune_string, ix86_arch_string): Delete. * config/i386/i386.c (ix86_cmodel_string, ix86_asm_string) (ix86_tls_dialect_string, ix86_tune_string, ix86_arch_string) (ix86_fpmath_string, ix86_regparm_string, ix86_align_loops_string) (ix86_align_jumps_string, ix86_preferred_stack_boundary_string) (ix86_branch_cost_string, ix86_align_funcs_string): Delete. (ix86_handle_option): Don't set the above variables here. * config/i386/i386.opt (malign-functions=, malign-jumps=) (malign-loops=, march=, masm=, mbranch-cost=, mcmodel=, mfpmath=) (mpreferred-stack-boundary=, mregparm=, mtls-dialect=, mtune=): Add Var()s. * config/ia64/ia64.h (ia64_tls_size): Delete. * config/ia64/ia64.c (ia64_tls_size): Delete. (ia64_handle_option): Treat -mtls-size= as a UInteger option, reading the integer argument from the "value" parameter. Don't set ia64_tls_size here. * config/ia64/ia64.opt (mtls-size=): Turn into a UInteger option. Add Var() and Init(). * config/m32r/m32r.h (m32r_cache_flush_func): Delete. (m32r_cache_flush_trap): Delete. * config/m32r/m32r.c (m32r_cache_flush_func): Delete. (m32r_cache_flush_trap): Delete. (m32r_handle_option): Don't set the above variables when handling -mflush-func= and -mflush-trap=. * config/m32r/m32r.opt (-mflush-func=, -mflush-trap=): Add Var()s and Init()s. * config/mips/mips.h (mips_cache_flush_func): Delete. * config/mips/mips.c (mips_arch_string, mips_tune_string) (mips_cache_flush_func): Delete. (mips_handle_option): Don't set the above variables when handling -march=, -mtune= and -mflush-func=. * config/mips/mips.opt (march=, mflush-func=, mtune=): Add Var()s. * config/s390/s390.c (s390_arch_string): Delete. (s390_handle_option): Don't set it here. * config/s390/s390.opt (march=): Add Var(). * config/sparc/sparc.h (sparc_cmodel_string): Delete. * config/sparc/sparc.c (sparc_cmodel_string): Delete. (sparc_handle_option): Don't set it here. * config/sparc/sparc.opt (mcmodel=): Add Var(). From-SVN: r100185
2005-05-26 07:28:04 +02:00
if (value != 14 && value != 22 && value != 64)
error ("bad value %<%s%> for -mtls-size= switch", arg);
return true;
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
case OPT_mtune_:
{
static struct pta
{
const char *name; /* processor name or nickname. */
enum processor_type processor;
}
const processor_alias_table[] =
{
{"itanium", PROCESSOR_ITANIUM},
{"itanium1", PROCESSOR_ITANIUM},
{"merced", PROCESSOR_ITANIUM},
{"itanium2", PROCESSOR_ITANIUM2},
{"mckinley", PROCESSOR_ITANIUM2},
};
int const pta_size = ARRAY_SIZE (processor_alias_table);
int i;
for (i = 0; i < pta_size; i++)
if (!strcmp (arg, processor_alias_table[i].name))
{
ia64_tune = processor_alias_table[i].processor;
if (ia64_tune == PROCESSOR_ITANIUM
&& ! warned_itanium1_deprecated)
{
inform (0,
"value %<%s%> for -mtune= switch is deprecated",
arg);
inform (0, "GCC 4.4 is the last release with "
"Itanium1 tuning support");
warned_itanium1_deprecated = true;
}
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
break;
}
if (i == pta_size)
error ("bad value %<%s%> for -mtune= switch", arg);
return true;
}
default:
return true;
}
}
/* Implement OVERRIDE_OPTIONS. */
2000-03-09 01:26:04 +01:00
void
ia64_override_options (void)
2000-03-09 01:26:04 +01:00
{
if (TARGET_AUTO_PIC)
target_flags |= MASK_CONST_GP;
ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
flag_schedule_insns_after_reload = 0;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (optimize >= 3
&& ! sel_sched_switch_set)
{
flag_selective_scheduling2 = 1;
flag_sel_sched_pipelining = 1;
}
if (mflag_sched_control_spec == 2)
{
/* Control speculation is on by default for the selective scheduler,
but not for the Haifa scheduler. */
mflag_sched_control_spec = flag_selective_scheduling2 ? 1 : 0;
}
if (flag_sel_sched_pipelining && flag_auto_inc_dec)
{
/* FIXME: remove this when we'd implement breaking autoinsns as
a transformation. */
flag_auto_inc_dec = 0;
}
2000-03-09 01:26:04 +01:00
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (align_functions <= 0)
align_functions = 64;
if (align_loops <= 0)
align_loops = 32;
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
if (TARGET_ABI_OPEN_VMS)
flag_no_common = 1;
2000-03-09 01:26:04 +01:00
}
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
/* Initialize the record of emitted frame related registers. */
void ia64_init_expanders (void)
{
memset (&emitted_frame_related_regs, 0, sizeof (emitted_frame_related_regs));
}
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
static struct machine_function *
ia64_init_machine_status (void)
{
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
return GGC_CNEW (struct machine_function);
config.gcc (ia64*-*-hpux*): Add extra_options. * config.gcc (ia64*-*-hpux*): Add extra_options. * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.c (ia64_fixed_range_string): Remove. (ia64_tls_size_string, ia64_tune_string): Remove. (ia64_tune): Init to PROCESSOR_ITANIUM2. (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, TARGET_EARLY_STOP_BITS): Remove. (TARGET_ILP32): Default false. (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. (enum ia64_inline_type): New. (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. * config/ia64/ia64.md: Update for new definitions of TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. * config/ia64/ia64.opt: New file. * config/ia64/ilp32.opt: New file. From-SVN: r96621
2005-03-17 18:35:16 +01:00
}
2000-03-09 01:26:04 +01:00
static enum attr_itanium_class ia64_safe_itanium_class (rtx);
static enum attr_type ia64_safe_type (rtx);
static enum attr_itanium_class
ia64_safe_itanium_class (rtx insn)
{
if (recog_memoized (insn) >= 0)
return get_attr_itanium_class (insn);
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
else if (DEBUG_INSN_P (insn))
return ITANIUM_CLASS_IGNORE;
else
return ITANIUM_CLASS_UNKNOWN;
}
static enum attr_type
ia64_safe_type (rtx insn)
{
if (recog_memoized (insn) >= 0)
return get_attr_type (insn);
else
return TYPE_UNKNOWN;
}
2000-03-09 01:26:04 +01:00
/* The following collection of routines emit instruction group stop bits as
necessary to avoid dependencies. */
/* Need to track some additional registers as far as serialization is
concerned so we can properly handle br.call and br.ret. We could
make these registers visible to gcc, but since these registers are
never explicitly used in gcc generated code, it seems wasteful to
do so (plus it would make the call and return patterns needlessly
complex). */
#define REG_RP (BR_REG (0))
#define REG_AR_CFM (FIRST_PSEUDO_REGISTER + 1)
/* This is used for volatile asms which may require a stop bit immediately
before and after them. */
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
#define REG_VOLATILE (FIRST_PSEUDO_REGISTER + 2)
#define AR_UNAT_BIT_0 (FIRST_PSEUDO_REGISTER + 3)
#define NUM_REGS (AR_UNAT_BIT_0 + 64)
2000-03-09 01:26:04 +01:00
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
/* For each register, we keep track of how it has been written in the
current instruction group.
If a register is written unconditionally (no qualifying predicate),
WRITE_COUNT is set to 2 and FIRST_PRED is ignored.
If a register is written if its qualifying predicate P is true, we
set WRITE_COUNT to 1 and FIRST_PRED to P. Later on, the same register
may be written again by the complement of P (P^1) and when this happens,
WRITE_COUNT gets set to 2.
The result of this is that whenever an insn attempts to write a register
whose WRITE_COUNT is two, we need to issue an insn group barrier first.
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
If a predicate register is written by a floating-point insn, we set
WRITTEN_BY_FP to true.
If a predicate register is written by an AND.ORCM we set WRITTEN_BY_AND
to true; if it was written by an OR.ANDCM we set WRITTEN_BY_OR to true. */
#if GCC_VERSION >= 4000
#define RWS_FIELD_TYPE __extension__ unsigned short
#else
#define RWS_FIELD_TYPE unsigned int
#endif
2000-03-09 01:26:04 +01:00
struct reg_write_state
{
RWS_FIELD_TYPE write_count : 2;
RWS_FIELD_TYPE first_pred : 10;
RWS_FIELD_TYPE written_by_fp : 1;
RWS_FIELD_TYPE written_by_and : 1;
RWS_FIELD_TYPE written_by_or : 1;
2000-03-09 01:26:04 +01:00
};
/* Cumulative info for the current instruction group. */
struct reg_write_state rws_sum[NUM_REGS];
#ifdef ENABLE_CHECKING
/* Bitmap whether a register has been written in the current insn. */
HARD_REG_ELT_TYPE rws_insn[(NUM_REGS + HOST_BITS_PER_WIDEST_FAST_INT - 1)
/ HOST_BITS_PER_WIDEST_FAST_INT];
static inline void
rws_insn_set (int regno)
{
gcc_assert (!TEST_HARD_REG_BIT (rws_insn, regno));
SET_HARD_REG_BIT (rws_insn, regno);
}
static inline int
rws_insn_test (int regno)
{
return TEST_HARD_REG_BIT (rws_insn, regno);
}
#else
/* When not checking, track just REG_AR_CFM and REG_VOLATILE. */
unsigned char rws_insn[2];
static inline void
rws_insn_set (int regno)
{
if (regno == REG_AR_CFM)
rws_insn[0] = 1;
else if (regno == REG_VOLATILE)
rws_insn[1] = 1;
}
static inline int
rws_insn_test (int regno)
{
if (regno == REG_AR_CFM)
return rws_insn[0];
if (regno == REG_VOLATILE)
return rws_insn[1];
return 0;
}
#endif
2000-03-09 01:26:04 +01:00
/* Indicates whether this is the first instruction after a stop bit,
in which case we don't need another stop bit. Without this,
ia64_variable_issue will die when scheduling an alloc. */
static int first_instruction;
2000-03-09 01:26:04 +01:00
/* Misc flags needed to compute RAW/WAW dependencies while we are traversing
RTL for one instruction. */
struct reg_flags
{
unsigned int is_write : 1; /* Is register being written? */
unsigned int is_fp : 1; /* Is register used as part of an fp op? */
unsigned int is_branch : 1; /* Is register used as part of a branch? */
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
unsigned int is_and : 1; /* Is register used as part of and.orcm? */
unsigned int is_or : 1; /* Is register used as part of or.andcm? */
unsigned int is_sibcall : 1; /* Is this a sibling or normal call? */
2000-03-09 01:26:04 +01:00
};
static void rws_update (int, struct reg_flags, int);
static int rws_access_regno (int, struct reg_flags, int);
static int rws_access_reg (rtx, struct reg_flags, int);
static void update_set_flags (rtx, struct reg_flags *);
static int set_src_needs_barrier (rtx, struct reg_flags, int);
static int rtx_needs_barrier (rtx, struct reg_flags, int);
static void init_insn_group_barriers (void);
static int group_barrier_needed (rtx);
static int safe_group_barrier_needed (rtx);
static int in_safe_group_barrier;
2000-03-09 01:26:04 +01:00
/* Update *RWS for REGNO, which is being written by the current instruction,
with predicate PRED, and associated register flags in FLAGS. */
static void
rws_update (int regno, struct reg_flags flags, int pred)
2000-03-09 01:26:04 +01:00
{
if (pred)
rws_sum[regno].write_count++;
else
rws_sum[regno].write_count = 2;
rws_sum[regno].written_by_fp |= flags.is_fp;
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
/* ??? Not tracking and/or across differing predicates. */
rws_sum[regno].written_by_and = flags.is_and;
rws_sum[regno].written_by_or = flags.is_or;
rws_sum[regno].first_pred = pred;
2000-03-09 01:26:04 +01:00
}
/* Handle an access to register REGNO of type FLAGS using predicate register
PRED. Update rws_sum array. Return 1 if this access creates
2000-03-09 01:26:04 +01:00
a dependency with an earlier instruction in the same group. */
static int
rws_access_regno (int regno, struct reg_flags flags, int pred)
2000-03-09 01:26:04 +01:00
{
int need_barrier = 0;
gcc_assert (regno < NUM_REGS);
2000-03-09 01:26:04 +01:00
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
if (! PR_REGNO_P (regno))
flags.is_and = flags.is_or = 0;
2000-03-09 01:26:04 +01:00
if (flags.is_write)
{
int write_count;
rws_insn_set (regno);
write_count = rws_sum[regno].write_count;
switch (write_count)
2000-03-09 01:26:04 +01:00
{
case 0:
/* The register has not been written yet. */
if (!in_safe_group_barrier)
rws_update (regno, flags, pred);
2000-03-09 01:26:04 +01:00
break;
case 1:
/* The register has been written via a predicate. If this is
not a complementary predicate, then we need a barrier. */
/* ??? This assumes that P and P+1 are always complementary
predicates for P even. */
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
if (flags.is_and && rws_sum[regno].written_by_and)
;
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
else if (flags.is_or && rws_sum[regno].written_by_or)
;
else if ((rws_sum[regno].first_pred ^ 1) != pred)
2000-03-09 01:26:04 +01:00
need_barrier = 1;
if (!in_safe_group_barrier)
rws_update (regno, flags, pred);
2000-03-09 01:26:04 +01:00
break;
case 2:
/* The register has been unconditionally written already. We
need a barrier. */
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
if (flags.is_and && rws_sum[regno].written_by_and)
;
else if (flags.is_or && rws_sum[regno].written_by_or)
;
else
need_barrier = 1;
if (!in_safe_group_barrier)
{
rws_sum[regno].written_by_and = flags.is_and;
rws_sum[regno].written_by_or = flags.is_or;
}
2000-03-09 01:26:04 +01:00
break;
default:
gcc_unreachable ();
2000-03-09 01:26:04 +01:00
}
}
else
{
if (flags.is_branch)
{
/* Branches have several RAW exceptions that allow to avoid
barriers. */
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
if (REGNO_REG_CLASS (regno) == BR_REGS || regno == AR_PFS_REGNUM)
2000-03-09 01:26:04 +01:00
/* RAW dependencies on branch regs are permissible as long
as the writer is a non-branch instruction. Since we
never generate code that uses a branch register written
by a branch instruction, handling this case is
easy. */
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
return 0;
2000-03-09 01:26:04 +01:00
if (REGNO_REG_CLASS (regno) == PR_REGS
&& ! rws_sum[regno].written_by_fp)
/* The predicates of a branch are available within the
same insn group as long as the predicate was written by
something other than a floating-point instruction. */
2000-03-09 01:26:04 +01:00
return 0;
}
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
if (flags.is_and && rws_sum[regno].written_by_and)
return 0;
if (flags.is_or && rws_sum[regno].written_by_or)
return 0;
2000-03-09 01:26:04 +01:00
switch (rws_sum[regno].write_count)
{
case 0:
/* The register has not been written yet. */
break;
case 1:
/* The register has been written via a predicate. If this is
not a complementary predicate, then we need a barrier. */
/* ??? This assumes that P and P+1 are always complementary
predicates for P even. */
if ((rws_sum[regno].first_pred ^ 1) != pred)
need_barrier = 1;
break;
case 2:
/* The register has been unconditionally written already. We
need a barrier. */
need_barrier = 1;
break;
default:
gcc_unreachable ();
2000-03-09 01:26:04 +01:00
}
}
return need_barrier;
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static int
rws_access_reg (rtx reg, struct reg_flags flags, int pred)
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
{
int regno = REGNO (reg);
int n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
if (n == 1)
return rws_access_regno (regno, flags, pred);
else
{
int need_barrier = 0;
while (--n >= 0)
need_barrier |= rws_access_regno (regno + n, flags, pred);
return need_barrier;
}
}
/* Examine X, which is a SET rtx, and update the flags, the predicate, and
the condition, stored in *PFLAGS, *PPRED and *PCOND. */
static void
update_set_flags (rtx x, struct reg_flags *pflags)
{
rtx src = SET_SRC (x);
switch (GET_CODE (src))
{
case CALL:
return;
case IF_THEN_ELSE:
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* There are four cases here:
(1) The destination is (pc), in which case this is a branch,
nothing here applies.
(2) The destination is ar.lc, in which case this is a
doloop_end_internal,
(3) The destination is an fp register, in which case this is
an fselect instruction.
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
(4) The condition has (unspec [(reg)] UNSPEC_LDC), in which case
this is a check load.
In all cases, nothing we do in this function applies. */
return;
default:
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes... 2004-02-07 Paolo Bonzini <bonzini@gnu.org> * alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes, possibly splitting conditionals that tested against '<' and 'o'. * caller-save.c (save_call_clobbered_regs): Likewise. * combine.c (contains_muldiv, find_split_point, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, simplify_logical, expand_compound_operation, make_compound_operation, if_then_else_cond, known_cond, apply_distributive_law, cached_nonzero_bits, cached_num_sign_bit_copies, simplify_shift_const, gen_binary, simplify_comparison, update_table_tick, record_value_for_reg, get_lsat_value_validate): Likewise. * cse.c (mention_regs, find_best_addr, find_comparison_args, fold_rtx, cse_insn, invalidate_memory, cse_basic_block): Likewise. * emit-rtl.c (copy_insn_1): Likewise. * expr.c (force_operand): Likewise. * final.c (final_scan_insn, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond, and_reg_cond, elim_reg_cond): Likewise. * function.c (update_epilogue_consts): Likewise. * genattrtab.c (attr_rtx_1): Likewise. * genopinit.c (gen_insn): Likewise. * integrate.c (subst_constants): Likewise. * jump.c (reversed_comparison_code_parts, reversed_comparison_code, delete_related_insns, rtx_renumbered_equal_p): Likewise. * local-alloc.c (block_alloc): Likewise. * loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv, canonicalize_condition): Likewise. * loop-iv.c (simplify_using_conditions, iv_number_of_iterations): Likewise. * optabs.c (add_equal_node, expand_binop): Likewise. * predict.c (estimate_probability): Likewise. * ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise. * recog.c (validate_replace_rtx_1, comparison_operator, offsettable_address_p, constrain_operands): Likewise. * reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (stable_and_no_regs_but_for_p): Likewise. * regrename.c (kill_autoinc_value): Likewise. * reload.c (find_reusable_reload, find_reloads, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (gen_reload, delete_address_reloads_1): Likewise. * rtl.c (copy_rtx): Likewise. * rtl.h (CONSTANT_P, INSN_P): Likewise. * rtlanal.c (commutative_operand_precedence): Likewise. * sched-deps.c (conditions_mutex_p): Likewise. * sched-rgn.c (is_cfg_nonregular): Likewise. * simplify-rtx.c (simplify_gen_binary, simplify_gen_relational, simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_ternary_operation, simplify_rtx): Likewise. * unroll.c (reg_dead_after_loop): Likewise. * config/alpha/alpha.c (alpha_swapped_comparison_operator, print_operand): Likewise. * config/arc/arc.c (proper_comparison_operator): Likewise. * config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode): Likewise. * config/avr/avr.c (_reg_unused_after): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests, frv_ifcvt_modify_insn, frv_pack_insn): Likewise. * config/i386/i386.c (ix86_comparison_operator, ix86_carry_flag_operator, fcmov_comparison_operator, arith_or_logical_operator, print_operand, ix86_expand_binary_operator, ix86_binary_operator_ok): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (not_postinc_memory_operand, ia64_print_operand, update_set_flags, errata_emit_nops): Likewise. * config/ia64/ia64.h (PREFERRED_RELOAD_CLASS, CONSTRAINT_OK_FOR_S): Likewise. * config/ip2k/ip2k.c (mdr_resequence_xy_yx, mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p, ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator): Likewise. * config/iq2000/iq2000.c (cmp_op, symbolic_expression_p, eqne_comparison_operator, signed_comparison_operator): Likewise. * config/mips/mips.c (cmp_op, symbolic_expression_p): Likewise. * config/mmix/mmix (mmix_foldable_comparison_operator, mmix_comparison_operator): Likewise. * config/pa/pa.c (hppa_legitimize_address): Likewise. * config/rs6000/rs6000.c (stmw_operation, branch_comparison_operator, trap_comparison_operator, ccr_bit): Likewise. * config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise. * config/s390/s390.c (s390_alc_comparison, s390_slb_comparison):L Likewise. * config/sh/sh.c (gen_block_redirect, reg_unused_after): Likewise. * config/sparc/sparc.c (eq_or_neq, normal_comp_operator, noov_compare_op, noov_compare64_op, v9_regcmp_op, emit_hard_tfmode_operation, reg_unused_after) * doc/md.texi, doc/rtl.texi: Likewise. * ra-debug.c: Add 2004 to list of copyright years. * unroll.c: Likewise. * combine.c (simplify_logical): Remove dummy test, (apply_distributive_law): Fix typo in comment. GET_CODE (x) == AND so x is a commutative binary op. * jump.c (delete_related_insns): simplify loop condition, move testing of RTX codes inside the loop. (rtx_renumbered_equal_p): do not use RTX_CODE. * rtl.c (rtx_class): Declare as enum rtx_class. * rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED): Move to RTX_COMM_COMPARE class. (HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE): Move to RTX_CONST_OBJ class. * rtl.h (enum rtx_class): New declaration, (RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK, RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT, RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK, RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT, RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P, ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P, SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P, OBJECT_P): New macros. * config/sparc/sparc.c (noov_compare_op): Remove register from parameter. From-SVN: r78824
2004-03-03 09:35:33 +01:00
if (COMPARISON_P (src)
&& SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (src, 0))))
/* Set pflags->is_fp to 1 so that we know we're dealing
with a floating point comparison when processing the
destination of the SET. */
pflags->is_fp = 1;
/* Discover if this is a parallel comparison. We only handle
and.orcm and or.andcm at present, since we must retain a
strict inverse on the predicate pair. */
else if (GET_CODE (src) == AND)
pflags->is_and = 1;
else if (GET_CODE (src) == IOR)
pflags->is_or = 1;
break;
}
}
/* Subroutine of rtx_needs_barrier; this function determines whether the
source of a given SET rtx found in X needs a barrier. FLAGS and PRED
are as in rtx_needs_barrier. COND is an rtx that holds the condition
for this insn. */
static int
set_src_needs_barrier (rtx x, struct reg_flags flags, int pred)
{
int need_barrier = 0;
rtx dst;
rtx src = SET_SRC (x);
if (GET_CODE (src) == CALL)
/* We don't need to worry about the result registers that
get written by subroutine call. */
return rtx_needs_barrier (src, flags, pred);
else if (SET_DEST (x) == pc_rtx)
{
/* X is a conditional branch. */
/* ??? This seems redundant, as the caller sets this bit for
all JUMP_INSNs. */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (!ia64_spec_check_src_p (src))
flags.is_branch = 1;
return rtx_needs_barrier (src, flags, pred);
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (ia64_spec_check_src_p (src))
/* Avoid checking one register twice (in condition
and in 'then' section) for ldc pattern. */
{
gcc_assert (REG_P (XEXP (src, 2)));
need_barrier = rtx_needs_barrier (XEXP (src, 2), flags, pred);
/* We process MEM below. */
src = XEXP (src, 1);
}
need_barrier |= rtx_needs_barrier (src, flags, pred);
dst = SET_DEST (x);
if (GET_CODE (dst) == ZERO_EXTRACT)
{
need_barrier |= rtx_needs_barrier (XEXP (dst, 1), flags, pred);
need_barrier |= rtx_needs_barrier (XEXP (dst, 2), flags, pred);
}
return need_barrier;
}
/* Handle an access to rtx X of type FLAGS using predicate register
PRED. Return 1 if this access creates a dependency with an earlier
instruction in the same group. */
2000-03-09 01:26:04 +01:00
static int
rtx_needs_barrier (rtx x, struct reg_flags flags, int pred)
2000-03-09 01:26:04 +01:00
{
int i, j;
int is_complemented = 0;
int need_barrier = 0;
const char *format_ptr;
struct reg_flags new_flags;
rtx cond;
2000-03-09 01:26:04 +01:00
if (! x)
return 0;
new_flags = flags;
switch (GET_CODE (x))
{
case SET:
update_set_flags (x, &new_flags);
need_barrier = set_src_needs_barrier (x, new_flags, pred);
if (GET_CODE (SET_SRC (x)) != CALL)
2000-03-09 01:26:04 +01:00
{
new_flags.is_write = 1;
need_barrier |= rtx_needs_barrier (SET_DEST (x), new_flags, pred);
2000-03-09 01:26:04 +01:00
}
break;
case CALL:
new_flags.is_write = 0;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier |= rws_access_regno (AR_EC_REGNUM, new_flags, pred);
2000-03-09 01:26:04 +01:00
/* Avoid multiple register writes, in case this is a pattern with
multiple CALL rtx. This avoids a failure in rws_access_reg. */
if (! flags.is_sibcall && ! rws_insn_test (REG_AR_CFM))
2000-03-09 01:26:04 +01:00
{
new_flags.is_write = 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier |= rws_access_regno (REG_RP, new_flags, pred);
need_barrier |= rws_access_regno (AR_PFS_REGNUM, new_flags, pred);
need_barrier |= rws_access_regno (REG_AR_CFM, new_flags, pred);
2000-03-09 01:26:04 +01:00
}
break;
case COND_EXEC:
/* X is a predicated instruction. */
cond = COND_EXEC_TEST (x);
gcc_assert (!pred);
need_barrier = rtx_needs_barrier (cond, flags, 0);
if (GET_CODE (cond) == EQ)
is_complemented = 1;
cond = XEXP (cond, 0);
gcc_assert (GET_CODE (cond) == REG
&& REGNO_REG_CLASS (REGNO (cond)) == PR_REGS);
pred = REGNO (cond);
if (is_complemented)
++pred;
need_barrier |= rtx_needs_barrier (COND_EXEC_CODE (x), flags, pred);
return need_barrier;
2000-03-09 01:26:04 +01:00
case CLOBBER:
case USE:
/* Clobber & use are for earlier compiler-phases only. */
break;
case ASM_OPERANDS:
case ASM_INPUT:
/* We always emit stop bits for traditional asms. We emit stop bits
for volatile extended asms if TARGET_VOL_ASM_STOP is true. */
if (GET_CODE (x) != ASM_OPERANDS
|| (MEM_VOLATILE_P (x) && TARGET_VOL_ASM_STOP))
{
/* Avoid writing the register multiple times if we have multiple
asm outputs. This avoids a failure in rws_access_reg. */
if (! rws_insn_test (REG_VOLATILE))
2000-03-09 01:26:04 +01:00
{
new_flags.is_write = 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rws_access_regno (REG_VOLATILE, new_flags, pred);
2000-03-09 01:26:04 +01:00
}
return 1;
}
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
We cannot just fall through here since then we would be confused
2000-03-09 01:26:04 +01:00
by the ASM_INPUT rtx inside ASM_OPERANDS, which do not indicate
traditional asms unlike their normal usage. */
for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; --i)
if (rtx_needs_barrier (ASM_OPERANDS_INPUT (x, i), flags, pred))
need_barrier = 1;
break;
case PARALLEL:
for (i = XVECLEN (x, 0) - 1; i >= 0; --i)
{
rtx pat = XVECEXP (x, 0, i);
switch (GET_CODE (pat))
{
case SET:
update_set_flags (pat, &new_flags);
need_barrier |= set_src_needs_barrier (pat, new_flags, pred);
break;
case USE:
case CALL:
case ASM_OPERANDS:
need_barrier |= rtx_needs_barrier (pat, flags, pred);
break;
case CLOBBER:
case RETURN:
break;
default:
gcc_unreachable ();
}
}
for (i = XVECLEN (x, 0) - 1; i >= 0; --i)
{
rtx pat = XVECEXP (x, 0, i);
if (GET_CODE (pat) == SET)
{
if (GET_CODE (SET_SRC (pat)) != CALL)
{
new_flags.is_write = 1;
need_barrier |= rtx_needs_barrier (SET_DEST (pat), new_flags,
pred);
}
}
else if (GET_CODE (pat) == CLOBBER || GET_CODE (pat) == RETURN)
need_barrier |= rtx_needs_barrier (pat, flags, pred);
}
2000-03-09 01:26:04 +01:00
break;
case SUBREG:
need_barrier |= rtx_needs_barrier (SUBREG_REG (x), flags, pred);
break;
2000-03-09 01:26:04 +01:00
case REG:
if (REGNO (x) == AR_UNAT_REGNUM)
{
for (i = 0; i < 64; ++i)
need_barrier |= rws_access_regno (AR_UNAT_BIT_0 + i, flags, pred);
}
else
need_barrier = rws_access_reg (x, flags, pred);
2000-03-09 01:26:04 +01:00
break;
case MEM:
/* Find the regs used in memory address computation. */
new_flags.is_write = 0;
need_barrier = rtx_needs_barrier (XEXP (x, 0), new_flags, pred);
break;
case CONST_INT: case CONST_DOUBLE: case CONST_VECTOR:
2000-03-09 01:26:04 +01:00
case SYMBOL_REF: case LABEL_REF: case CONST:
break;
/* Operators with side-effects. */
case POST_INC: case POST_DEC:
gcc_assert (GET_CODE (XEXP (x, 0)) == REG);
2000-03-09 01:26:04 +01:00
new_flags.is_write = 0;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier = rws_access_reg (XEXP (x, 0), new_flags, pred);
2000-03-09 01:26:04 +01:00
new_flags.is_write = 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier |= rws_access_reg (XEXP (x, 0), new_flags, pred);
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
break;
case POST_MODIFY:
gcc_assert (GET_CODE (XEXP (x, 0)) == REG);
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
new_flags.is_write = 0;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier = rws_access_reg (XEXP (x, 0), new_flags, pred);
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. From-SVN: r35321
2000-07-28 19:46:18 +02:00
need_barrier |= rtx_needs_barrier (XEXP (x, 1), new_flags, pred);
new_flags.is_write = 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier |= rws_access_reg (XEXP (x, 0), new_flags, pred);
2000-03-09 01:26:04 +01:00
break;
/* Handle common unary and binary ops for efficiency. */
case COMPARE: case PLUS: case MINUS: case MULT: case DIV:
case MOD: case UDIV: case UMOD: case AND: case IOR:
case XOR: case ASHIFT: case ROTATE: case ASHIFTRT: case LSHIFTRT:
case ROTATERT: case SMIN: case SMAX: case UMIN: case UMAX:
case NE: case EQ: case GE: case GT: case LE:
case LT: case GEU: case GTU: case LEU: case LTU:
need_barrier = rtx_needs_barrier (XEXP (x, 0), new_flags, pred);
need_barrier |= rtx_needs_barrier (XEXP (x, 1), new_flags, pred);
break;
case NEG: case NOT: case SIGN_EXTEND: case ZERO_EXTEND:
case TRUNCATE: case FLOAT_EXTEND: case FLOAT_TRUNCATE: case FLOAT:
case FIX: case UNSIGNED_FLOAT: case UNSIGNED_FIX: case ABS:
case SQRT: case FFS: case POPCOUNT:
2000-03-09 01:26:04 +01:00
need_barrier = rtx_needs_barrier (XEXP (x, 0), flags, pred);
break;
case VEC_SELECT:
/* VEC_SELECT's second argument is a PARALLEL with integers that
describe the elements selected. On ia64, those integers are
always constants. Avoid walking the PARALLEL so that we don't
get confused with "normal" parallels and then die. */
need_barrier = rtx_needs_barrier (XEXP (x, 0), flags, pred);
break;
2000-03-09 01:26:04 +01:00
case UNSPEC:
switch (XINT (x, 1))
{
configure.in (HAVE_AS_TLS): Add ia64 test. * configure.in (HAVE_AS_TLS): Add ia64 test. * configure: Rebuild. * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. (override_options): Set it. (TARGET_HAVE_TLS): New. (sdata_symbolic_operand): Look for 's'. (tls_symbolic_operand): New. (ia64_expand_load_address): Abort for tls symbols. (gen_tls_get_addr): New. (gen_thread_pointer): New. (ia64_expand_move): Split out from movdi. Handle tls symbols. (rtx_needs_barrier): Add new unspecs. (ia64_encode_section_info): Handle tls symbols. (ia64_strip_name_encoding): Strip two encoding chars. * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. (TARGET_OPTIONS): Add tls-size. (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. (movsf, movdf): Likewise. (movdi_symbolic): Use match_scratch. Don't split if we won't have a scratch availiable. (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. * config/ia64/ia64-protos.h: Update. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use sdata_symbolic_operand. (ASM_OUTPUT_LABELREF): Strip two characters. From-SVN: r53874
2002-05-25 21:51:43 +02:00
case UNSPEC_LTOFF_DTPMOD:
case UNSPEC_LTOFF_DTPREL:
case UNSPEC_DTPREL:
case UNSPEC_LTOFF_TPREL:
case UNSPEC_TPREL:
case UNSPEC_PRED_REL_MUTEX:
case UNSPEC_PIC_CALL:
case UNSPEC_MF:
case UNSPEC_FETCHADD_ACQ:
case UNSPEC_BSP_VALUE:
case UNSPEC_FLUSHRS:
case UNSPEC_BUNDLE_SELECTOR:
break;
case UNSPEC_GR_SPILL:
case UNSPEC_GR_RESTORE:
{
HOST_WIDE_INT offset = INTVAL (XVECEXP (x, 0, 1));
HOST_WIDE_INT bit = (offset >> 3) & 63;
need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred);
new_flags.is_write = (XINT (x, 1) == UNSPEC_GR_SPILL);
need_barrier |= rws_access_regno (AR_UNAT_BIT_0 + bit,
new_flags, pred);
break;
}
case UNSPEC_FR_SPILL:
case UNSPEC_FR_RESTORE:
case UNSPEC_GETF_EXP:
case UNSPEC_SETF_EXP:
case UNSPEC_ADDP4:
case UNSPEC_FR_SQRT_RECIP_APPROX:
case UNSPEC_FR_SQRT_RECIP_APPROX_RES:
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
case UNSPEC_LDA:
case UNSPEC_LDS:
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
case UNSPEC_LDS_A:
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
case UNSPEC_LDSA:
case UNSPEC_CHKACLR:
case UNSPEC_CHKS:
need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred);
break;
case UNSPEC_FR_RECIP_APPROX:
case UNSPEC_SHRP:
case UNSPEC_COPYSIGN:
case UNSPEC_FR_RECIP_APPROX_RES:
need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred);
need_barrier |= rtx_needs_barrier (XVECEXP (x, 0, 1), flags, pred);
break;
case UNSPEC_CMPXCHG_ACQ:
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 1), flags, pred);
need_barrier |= rtx_needs_barrier (XVECEXP (x, 0, 2), flags, pred);
break;
2000-03-09 01:26:04 +01:00
default:
gcc_unreachable ();
2000-03-09 01:26:04 +01:00
}
break;
case UNSPEC_VOLATILE:
switch (XINT (x, 1))
{
case UNSPECV_ALLOC:
/* Alloc must always be the first instruction of a group.
We force this by always returning true. */
/* ??? We might get better scheduling if we explicitly check for
input/local/output register dependencies, and modify the
scheduler so that alloc is always reordered to the start of
the current group. We could then eliminate all of the
first_instruction code. */
rws_access_regno (AR_PFS_REGNUM, flags, pred);
2000-03-09 01:26:04 +01:00
new_flags.is_write = 1;
rws_access_regno (REG_AR_CFM, new_flags, pred);
return 1;
2000-03-09 01:26:04 +01:00
case UNSPECV_SET_BSP:
need_barrier = 1;
break;
case UNSPECV_BLOCKAGE:
case UNSPECV_INSN_GROUP_BARRIER:
case UNSPECV_BREAK:
case UNSPECV_PSAC_ALL:
case UNSPECV_PSAC_NORMAL:
return 0;
2000-03-09 01:26:04 +01:00
default:
gcc_unreachable ();
2000-03-09 01:26:04 +01:00
}
break;
case RETURN:
new_flags.is_write = 0;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier = rws_access_regno (REG_RP, flags, pred);
need_barrier |= rws_access_regno (AR_PFS_REGNUM, flags, pred);
2000-03-09 01:26:04 +01:00
new_flags.is_write = 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
need_barrier |= rws_access_regno (AR_EC_REGNUM, new_flags, pred);
need_barrier |= rws_access_regno (REG_AR_CFM, new_flags, pred);
2000-03-09 01:26:04 +01:00
break;
default:
format_ptr = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
switch (format_ptr[i])
{
case '0': /* unused field */
case 'i': /* integer */
case 'n': /* note */
case 'w': /* wide integer */
case 's': /* pointer to string */
case 'S': /* optional pointer to string */
break;
case 'e':
if (rtx_needs_barrier (XEXP (x, i), flags, pred))
need_barrier = 1;
break;
case 'E':
for (j = XVECLEN (x, i) - 1; j >= 0; --j)
if (rtx_needs_barrier (XVECEXP (x, i, j), flags, pred))
need_barrier = 1;
break;
default:
gcc_unreachable ();
2000-03-09 01:26:04 +01:00
}
break;
2000-03-09 01:26:04 +01:00
}
return need_barrier;
}
/* Clear out the state for group_barrier_needed at the start of a
sequence of insns. */
static void
init_insn_group_barriers (void)
{
memset (rws_sum, 0, sizeof (rws_sum));
first_instruction = 1;
}
/* Given the current state, determine whether a group barrier (a stop bit) is
necessary before INSN. Return nonzero if so. This modifies the state to
include the effects of INSN as a side-effect. */
static int
group_barrier_needed (rtx insn)
{
rtx pat;
int need_barrier = 0;
struct reg_flags flags;
memset (&flags, 0, sizeof (flags));
switch (GET_CODE (insn))
{
case NOTE:
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
case DEBUG_INSN:
break;
case BARRIER:
/* A barrier doesn't imply an instruction group boundary. */
break;
case CODE_LABEL:
memset (rws_insn, 0, sizeof (rws_insn));
return 1;
case CALL_INSN:
flags.is_branch = 1;
flags.is_sibcall = SIBLING_CALL_P (insn);
memset (rws_insn, 0, sizeof (rws_insn));
/* Don't bundle a call following another call. */
if ((pat = prev_active_insn (insn))
&& GET_CODE (pat) == CALL_INSN)
{
need_barrier = 1;
break;
}
need_barrier = rtx_needs_barrier (PATTERN (insn), flags, 0);
break;
case JUMP_INSN:
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (!ia64_spec_check_p (insn))
flags.is_branch = 1;
/* Don't bundle a jump following a call. */
if ((pat = prev_active_insn (insn))
&& GET_CODE (pat) == CALL_INSN)
{
need_barrier = 1;
break;
}
/* FALLTHRU */
case INSN:
if (GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER)
/* Don't care about USE and CLOBBER "insns"---those are used to
indicate to the optimizer that it shouldn't get rid of
certain operations. */
break;
pat = PATTERN (insn);
/* Ug. Hack hacks hacked elsewhere. */
switch (recog_memoized (insn))
{
/* We play dependency tricks with the epilogue in order
to get proper schedules. Undo this for dv analysis. */
case CODE_FOR_epilogue_deallocate_stack:
case CODE_FOR_prologue_allocate_stack:
pat = XVECEXP (pat, 0, 0);
break;
/* The pattern we use for br.cloop confuses the code above.
The second element of the vector is representative. */
case CODE_FOR_doloop_end_internal:
pat = XVECEXP (pat, 0, 1);
break;
/* Doesn't generate code. */
case CODE_FOR_pred_rel_mutex:
case CODE_FOR_prologue_use:
return 0;
default:
break;
}
memset (rws_insn, 0, sizeof (rws_insn));
need_barrier = rtx_needs_barrier (pat, flags, 0);
/* Check to see if the previous instruction was a volatile
asm. */
if (! need_barrier)
need_barrier = rws_access_regno (REG_VOLATILE, flags, 0);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
break;
default:
gcc_unreachable ();
}
if (first_instruction && INSN_P (insn)
&& ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER)
{
need_barrier = 0;
first_instruction = 0;
}
return need_barrier;
}
/* Like group_barrier_needed, but do not clobber the current state. */
static int
safe_group_barrier_needed (rtx insn)
{
int saved_first_instruction;
int t;
saved_first_instruction = first_instruction;
in_safe_group_barrier = 1;
t = group_barrier_needed (insn);
first_instruction = saved_first_instruction;
in_safe_group_barrier = 0;
return t;
}
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
/* Scan the current function and insert stop bits as necessary to
eliminate dependencies. This function assumes that a final
instruction scheduling pass has been run which has already
inserted most of the necessary stop bits. This function only
inserts new ones at basic block boundaries, since these are
invisible to the scheduler. */
static void
emit_insn_group_barriers (FILE *dump)
{
rtx insn;
rtx last_label = 0;
int insns_since_last_label = 0;
init_insn_group_barriers ();
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
if (GET_CODE (insn) == CODE_LABEL)
{
if (insns_since_last_label)
last_label = insn;
insns_since_last_label = 0;
}
else if (GET_CODE (insn) == NOTE
gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of NOTE_LINE_NUMBER... * gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. * ddg.c (create_ddg): LIkewise. * final.c (final): Remove hunk moving line numbernotes around since they are no longer present at this stage. (final_scan_insn): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. (output_asm_label): Likewise. * reorg.c (dbr_schedule): Likewise. * haifa-sched.c (unlink_other_notes): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * graph.c (start_bb): Likewise. * rtl.def (NOTE): Update description. * jump.c (squeeze_notes): Delete. (mark_jump_label): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. * ifcvt.c (dead_or_predicable): Remove call of squeeze_notes. * dwarf2out.c (gen_label_die): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. (dwarf2out_var_location): Likewise. * cfgbuild.c (make_edges): Likewise. (find_basic_blocks_1): Likewise. * function.c (reorder_blocks_1): Likewise. (epilogue_done): Likewise. (reposition_prologue_and_epilogue_notes): Likewise. * print-rtl.c (print_rtx): Likewise; drop code for printing line number notes. (print_rtl): Likewise. (print_rtl_single): Likewise. * gcse.c (insert_insn_start_bb): Likewise. * alias.c (init_alias_analysis): Likewise. * calls.c (fixup_tail_calls): Likewise. * except.c (sjlj_emit_function_enter): Likewise. * emit-rtl.c (add_insn_after): Likeiwse. (emit_label_before): Likewise. (emit_label_after): Likewise. (emit_note_before, emit_note_after, emit_note): Update parameter to be enum insn_note; do not deal with source files. * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. (merge_blocks_move_successor_nojumps): Simplify now when we don't have BLOCK notes. (try_optimize_cfg): Likewise. * cfglayout.c (skip_insns_after_block): Likewise. (record_effective_endpoints): Likewise. (duplicate_insn_chain): Likewise. * varasm.c (output_constant_pool_1): Likewise. * sched-deps.c (sched_analyze): Likewise. * rtl.c (NOTE_INSN_MAX_isnt_negative_adjust_NOTE_INSN_BIAS): Exterminate. (note_insn_name): Simplify now when NOTE_INSN_BIAS is gone. * rtl.h (NOTE_SOURCE_LOCATION, NOTE_EXPANDED_LOCATION): Exterminate. (SET_INSN_DELETED): Simplify. (NOTE_LINE_NUMBER): Exterminate. (NOTE_LINE_KIND): New. (NOTE_INSN_BASIC_BLOCK_P): Update. (enum insn_note): Simplify. (GET_NOTE_INSN_NAME) Simplify. (emit_note_before, emit_note_after, emit_note): Update prototype. (squeeze_notes): Remove. * sched-int.h (NOTE_NOT_BB_P): Update. * resource.c (mark_target_live_regs): Update. * sched-rgn.c (debug_dependencies): Update. * sched-vis.c (print_insn): Update. * config/alpha/alpha.c (alpha_handle_trap_shadows): Update. * config/i386/i386.c (ix86_output_function_epilogue): Update. * config/sh/sh.c (sh_adjust_unroll_max): Function dead since gcc 4.0.0. (TARGET_ADJUST_UNROLL_MAX): Likewise. (split_branches): Update. (sh_optimize_target_register_callee_saved): Remove hunk dead since gcc 4.0.0. (sh_adjust_unroll_max): Exterminate. * config/c4x/c4x.c (c4x_reorg): Use SET_INSN_DELETED. * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Likewise. (m68hc11_reorg): Likewise. * config/ia64/ia64.c (emit_insn_group_barriers): Update. (emit_predicate_relation_info): Update. (process_for_unwind_directive): Update. * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Update. (output_call): Update. * config/pa/pa.c (output_lbranch): Update. (output_millicode_call): Update. (output_call): Update. (pa_combine_instructions): Update. * config/mips/mips.c (mips16_gp_pseudo_reg): Update. * config/bfin/bfin.c (gen_one_bundle): Update. * cfgrtl.c (can_delete_note_p): Update. (delete_insn): Update. (rtl_merge_blocks): Update. (commit_one_edge_insertion): Update. (rtl_verify_flow_info): Update. * stmt.c (expand_case): Do not call squeeze_notes. From-SVN: r124895
2007-05-21 08:19:50 +02:00
&& NOTE_KIND (insn) == NOTE_INSN_BASIC_BLOCK)
{
if (insns_since_last_label)
last_label = insn;
insns_since_last_label = 0;
}
else if (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
&& XINT (PATTERN (insn), 1) == UNSPECV_INSN_GROUP_BARRIER)
{
init_insn_group_barriers ();
last_label = 0;
}
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
else if (NONDEBUG_INSN_P (insn))
{
insns_since_last_label = 1;
if (group_barrier_needed (insn))
{
if (last_label)
{
if (dump)
fprintf (dump, "Emitting stop before label %d\n",
INSN_UID (last_label));
emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), last_label);
insn = last_label;
init_insn_group_barriers ();
last_label = 0;
}
}
}
}
}
/* Like emit_insn_group_barriers, but run if no final scheduling pass was run.
This function has to emit all necessary group barriers. */
static void
emit_all_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
{
rtx insn;
init_insn_group_barriers ();
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
if (GET_CODE (insn) == BARRIER)
{
rtx last = prev_active_insn (insn);
if (! last)
continue;
if (GET_CODE (last) == JUMP_INSN
&& GET_CODE (PATTERN (last)) == ADDR_DIFF_VEC)
last = prev_active_insn (last);
if (recog_memoized (last) != CODE_FOR_insn_group_barrier)
emit_insn_after (gen_insn_group_barrier (GEN_INT (3)), last);
init_insn_group_barriers ();
}
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
else if (NONDEBUG_INSN_P (insn))
{
if (recog_memoized (insn) == CODE_FOR_insn_group_barrier)
init_insn_group_barriers ();
else if (group_barrier_needed (insn))
{
emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn);
init_insn_group_barriers ();
group_barrier_needed (insn);
}
}
}
}
/* Instruction scheduling support. */
#define NR_BUNDLES 10
/* A list of names of all available bundles. */
static const char *bundle_name [NR_BUNDLES] =
{
".mii",
".mmi",
".mfi",
".mmf",
#if NR_BUNDLES == 10
".bbb",
".mbb",
#endif
".mib",
".mmb",
".mfb",
".mlx"
};
/* Nonzero if we should insert stop bits into the schedule. */
int ia64_final_schedule = 0;
/* Codes of the corresponding queried units: */
static int _0mii_, _0mmi_, _0mfi_, _0mmf_;
static int _0bbb_, _0mbb_, _0mib_, _0mmb_, _0mfb_, _0mlx_;
static int _1mii_, _1mmi_, _1mfi_, _1mmf_;
static int _1bbb_, _1mbb_, _1mib_, _1mmb_, _1mfb_, _1mlx_;
static int pos_1, pos_2, pos_3, pos_4, pos_5, pos_6;
/* The following variable value is an insn group barrier. */
static rtx dfa_stop_insn;
/* The following variable value is the last issued insn. */
static rtx last_scheduled_insn;
/* The following variable value is pointer to a DFA state used as
temporary variable. */
static state_t temp_dfa_state = NULL;
/* The following variable value is DFA state after issuing the last
insn. */
static state_t prev_cycle_state = NULL;
/* The following array element values are TRUE if the corresponding
insn requires to add stop bits before it. */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static char *stops_p = NULL;
/* The following variable is used to set up the mentioned above array. */
static int stop_before_p = 0;
/* The following variable value is length of the arrays `clocks' and
`add_cycles'. */
static int clocks_length;
/* The following array element values are cycles on which the
corresponding insn will be issued. The array is used only for
Itanium1. */
static int *clocks;
/* The following array element values are numbers of cycles should be
added to improve insn scheduling for MM_insns for Itanium1. */
static int *add_cycles;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* The following variable value is number of data speculations in progress. */
static int pending_data_specs = 0;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Number of memory references on current and three future processor cycles. */
static char mem_ops_in_group[4];
/* Number of current processor cycle (from scheduler's point of view). */
static int current_cycle;
static rtx ia64_single_set (rtx);
static void ia64_emit_insn_before (rtx, rtx);
/* Map a bundle number to its pseudo-op. */
const char *
get_bundle_name (int b)
{
return bundle_name[b];
}
/* Return the maximum number of instructions a cpu can issue. */
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
static int
ia64_issue_rate (void)
{
return 6;
}
/* Helper function - like single_set, but look inside COND_EXEC. */
static rtx
ia64_single_set (rtx insn)
{
rtx x = PATTERN (insn), ret;
if (GET_CODE (x) == COND_EXEC)
x = COND_EXEC_CODE (x);
if (GET_CODE (x) == SET)
return x;
/* Special case here prologue_allocate_stack and epilogue_deallocate_stack.
Although they are not classical single set, the second set is there just
to protect it from moving past FP-relative stack accesses. */
switch (recog_memoized (insn))
{
case CODE_FOR_prologue_allocate_stack:
case CODE_FOR_epilogue_deallocate_stack:
ret = XVECEXP (x, 0, 0);
break;
default:
ret = single_set_2 (insn, x);
break;
}
return ret;
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Adjust the cost of a scheduling dependency.
Return the new cost of a dependency of type DEP_TYPE or INSN on DEP_INSN.
COST is the current cost, DW is dependency weakness. */
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
static int
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
ia64_adjust_cost_2 (rtx insn, int dep_type1, rtx dep_insn, int cost, dw_t dw)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
enum reg_note dep_type = (enum reg_note) dep_type1;
enum attr_itanium_class dep_class;
enum attr_itanium_class insn_class;
insn_class = ia64_safe_itanium_class (insn);
dep_class = ia64_safe_itanium_class (dep_insn);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Treat true memory dependencies separately. Ignore apparent true
dependence between store and call (call has a MEM inside a SYMBOL_REF). */
if (dep_type == REG_DEP_TRUE
&& (dep_class == ITANIUM_CLASS_ST || dep_class == ITANIUM_CLASS_STF)
&& (insn_class == ITANIUM_CLASS_BR || insn_class == ITANIUM_CLASS_SCALL))
return 0;
if (dw == MIN_DEP_WEAK)
/* Store and load are likely to alias, use higher cost to avoid stall. */
return PARAM_VALUE (PARAM_SCHED_MEM_TRUE_DEP_COST);
else if (dw > MIN_DEP_WEAK)
{
/* Store and load are less likely to alias. */
if (mflag_sched_fp_mem_deps_zero_cost && dep_class == ITANIUM_CLASS_STF)
/* Assume there will be no cache conflict for floating-point data.
For integer data, L1 conflict penalty is huge (17 cycles), so we
never assume it will not cause a conflict. */
return 0;
else
return cost;
}
if (dep_type != REG_DEP_OUTPUT)
return cost;
if (dep_class == ITANIUM_CLASS_ST || dep_class == ITANIUM_CLASS_STF
|| insn_class == ITANIUM_CLASS_ST || insn_class == ITANIUM_CLASS_STF)
return 0;
return cost;
}
/* Like emit_insn_before, but skip cycle_display notes.
??? When cycle display notes are implemented, update this. */
static void
ia64_emit_insn_before (rtx insn, rtx before)
{
emit_insn_before (insn, before);
}
/* The following function marks insns who produce addresses for load
and store insns. Such insns will be placed into M slots because it
decrease latency time for Itanium1 (see function
`ia64_produce_address_p' and the DFA descriptions). */
static void
ia64_dependencies_evaluation_hook (rtx head, rtx tail)
{
re PR middle-end/28071 (A file that can not be compiled in reasonable time/space) * sched-int.h (ds_to_dk, dk_to_ds): Declare functions. (struct _dep): New type. (dep_t): New typedef. (DEP_PRO, DEP_CON, DEP_KIND): New access macros. (DEP_STATUS): New access macro. The macro with the same name was renamed to DEP_LINK_STATUS. (dep_init): Declare function (struct _dep_link): New type. (dep_link_t): New typedef. (DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros. (DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros. (DEP_LINK_STATUS): New macro. (debug_dep_links): New debug function. (struct _deps_list): New type. (deps_list_t): New typedef. (DEPS_LIST_FIRST): New access macro. (FOR_EACH_DEP_LINK): New cycle macro. (create_deps_list, free_deps_list, delete_deps_list): Declare functions. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Ditto. (move_dep_link): Declare function. (struct _dep_node): New type. (dep_node_t): New typedef. (DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros. (struct haifa_insn_data.back_deps): New field to hold backward dependencies of the insn. (struct haifa_insn_data.depend): Rename to forw_deps. Change its type to deps_list_t. (struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps. Change its type to deps_list_t. (INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS. (INSN_DEPEND): Rename to INSN_FORW_DEPS. (RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS. (INSN_COST): Move to haifa-sched.c. Use insn_cost () instead. (DEP_STATUS): Rename to DEP_LINK_STATUS. Fix typo in the comment. (add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and all callers. (dep_cost): Declare. * sched-deps.c (CHECK): New macro to (en/dis)able sanity checks. (ds_to_dk, dk_to_ds): New functions. (init_dep_1): New static function. (init_dep): New function. (copy_dep): New static function. (dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static functions. (detach_dep_link): New static function. (move_dep_link): New function. (dep_links_consistent_p, dump_dep_links): New static functions. (debug_dep_links): New debugging function. (deps_obstack, dl_obstack, dn_obstack): New static variables. (alloc_deps_list, init_deps_list): New static functions. (create_deps_list): New function. (clear_deps_list): New static function. (free_deps_list, delete_deps_list, deps_list_empty_p): New functions. (deps_list_consistent_p, dump_deps_list): New static functions. (debug_deps_list): New function. (add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New functions. (find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to use new scheduler dependencies lists. (add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto. (sched_analyze): Ditto. Initialize dependencies lists. (add_forw_dep, compute_forward_dependences): Update to use new scheduler dependencies lists. (init_dependency_caches): Init deps_obstack. (free_dependency_caches): Free deps_obstack. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use new scheduler dependencies lists. (delete_forw_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. * sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree): Update to use new scheduler dependencies lists. (is_conditionally_protected, is_prisky, add_branch_dependences): Ditto. (debug_dependencies): Ditto. (schedule_region): Update comments. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new scheduler dependencies lists. (schedule_ebb): Update comments. * rtl.def (DEPS_LIST): Remove. * lists.c (unused_deps_list): Remove. (free_list): Update assertions. (alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * haifa-sched.c (comments): Update. (insn_cost1): Remove. Inline the code into insn_cost (). (insn_cost): Update to use new scheduler dependencies lists. Move processing of the dependency cost to dep_cost (). (dep_cost): New function. Use it instead of insn_cost () when evaluating cost of the dependency. Use compatible interface to interact with the target. (priority): Update to use new scheduler dependencies lists. (rank_for_schedule): Ditto. Optimize heuristic that prefers the insn with greater number of insns that depend on the insn. (schedule_insn): Update to use new scheduler dependencies lists. Add code to free backward dependencies lists. Inline and optimize code from resolve_dep () - see PR28071. (ok_for_early_queue_removal): Update to use new scheduler dependencies lists. Update call to targetm.sched.is_costly_dependence hook. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new scheduler dependencies lists. (resolve_dep): Remove. Move the logic to schedule_insn (). (init_h_i_d): Initialize dependencies lists. (process_insn_depend_be_in_spec): Rename to process_insn_forw_deps_be_in_spec. Update to use new scheduler dependencies lists. (add_to_speculative_block, create_check_block_twin, fix_recovery_deps): Update to use new scheduler dependencies lists. (clear_priorities, calc_priorities, add_jump_dependencies): Ditto. * ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use new scheduler dependencies lists. (build_intra_loop_deps): Ditto. * target.h (struct _dep): Declare to use in gcc_target.sched.is_costly_dependence. (struct gcc_target.sched.adjust_cost): Fix typo. (struct gcc_target.sched.is_costly_dependence): Change signature to use single dep_t parameter instead of an equivalent triad. (struct gcc_target.sched.adjust_cost_2): Remove. * target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove. * reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments. * doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update documentation. (TARGET_SCHED_ADJUST_COST_2): Remove documentation. * doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler. (REG_DEP_TRUE): Document. * config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost. Change signature to correspond to the targetm.sched.adjust_cost hook. Update use in TARGET_SCHED_ADJUST_COST_2. (TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST. (ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use new scheduler dependencies lists. (ia64_gen_check): Ditto. * config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler dependencies lists. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change signature to correspond to the targetm.sched.is_costly_dependence hook. (is_costly_group): Update to use new scheduler dependencies lists. * config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function instead of INSN_COST () macro. From-SVN: r121494
2007-02-02 10:11:11 +01:00
rtx insn, next, next_tail;
/* Before reload, which_alternative is not set, which means that
ia64_safe_itanium_class will produce wrong results for (at least)
move instructions. */
if (!reload_completed)
return;
next_tail = NEXT_INSN (tail);
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
if (INSN_P (insn))
insn->call = 0;
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IALU)
{
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
sd_iterator_def sd_it;
dep_t dep;
bool has_mem_op_consumer_p = false;
re PR middle-end/28071 (A file that can not be compiled in reasonable time/space) * sched-int.h (ds_to_dk, dk_to_ds): Declare functions. (struct _dep): New type. (dep_t): New typedef. (DEP_PRO, DEP_CON, DEP_KIND): New access macros. (DEP_STATUS): New access macro. The macro with the same name was renamed to DEP_LINK_STATUS. (dep_init): Declare function (struct _dep_link): New type. (dep_link_t): New typedef. (DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros. (DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros. (DEP_LINK_STATUS): New macro. (debug_dep_links): New debug function. (struct _deps_list): New type. (deps_list_t): New typedef. (DEPS_LIST_FIRST): New access macro. (FOR_EACH_DEP_LINK): New cycle macro. (create_deps_list, free_deps_list, delete_deps_list): Declare functions. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Ditto. (move_dep_link): Declare function. (struct _dep_node): New type. (dep_node_t): New typedef. (DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros. (struct haifa_insn_data.back_deps): New field to hold backward dependencies of the insn. (struct haifa_insn_data.depend): Rename to forw_deps. Change its type to deps_list_t. (struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps. Change its type to deps_list_t. (INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS. (INSN_DEPEND): Rename to INSN_FORW_DEPS. (RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS. (INSN_COST): Move to haifa-sched.c. Use insn_cost () instead. (DEP_STATUS): Rename to DEP_LINK_STATUS. Fix typo in the comment. (add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and all callers. (dep_cost): Declare. * sched-deps.c (CHECK): New macro to (en/dis)able sanity checks. (ds_to_dk, dk_to_ds): New functions. (init_dep_1): New static function. (init_dep): New function. (copy_dep): New static function. (dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static functions. (detach_dep_link): New static function. (move_dep_link): New function. (dep_links_consistent_p, dump_dep_links): New static functions. (debug_dep_links): New debugging function. (deps_obstack, dl_obstack, dn_obstack): New static variables. (alloc_deps_list, init_deps_list): New static functions. (create_deps_list): New function. (clear_deps_list): New static function. (free_deps_list, delete_deps_list, deps_list_empty_p): New functions. (deps_list_consistent_p, dump_deps_list): New static functions. (debug_deps_list): New function. (add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New functions. (find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to use new scheduler dependencies lists. (add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto. (sched_analyze): Ditto. Initialize dependencies lists. (add_forw_dep, compute_forward_dependences): Update to use new scheduler dependencies lists. (init_dependency_caches): Init deps_obstack. (free_dependency_caches): Free deps_obstack. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use new scheduler dependencies lists. (delete_forw_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. * sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree): Update to use new scheduler dependencies lists. (is_conditionally_protected, is_prisky, add_branch_dependences): Ditto. (debug_dependencies): Ditto. (schedule_region): Update comments. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new scheduler dependencies lists. (schedule_ebb): Update comments. * rtl.def (DEPS_LIST): Remove. * lists.c (unused_deps_list): Remove. (free_list): Update assertions. (alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * haifa-sched.c (comments): Update. (insn_cost1): Remove. Inline the code into insn_cost (). (insn_cost): Update to use new scheduler dependencies lists. Move processing of the dependency cost to dep_cost (). (dep_cost): New function. Use it instead of insn_cost () when evaluating cost of the dependency. Use compatible interface to interact with the target. (priority): Update to use new scheduler dependencies lists. (rank_for_schedule): Ditto. Optimize heuristic that prefers the insn with greater number of insns that depend on the insn. (schedule_insn): Update to use new scheduler dependencies lists. Add code to free backward dependencies lists. Inline and optimize code from resolve_dep () - see PR28071. (ok_for_early_queue_removal): Update to use new scheduler dependencies lists. Update call to targetm.sched.is_costly_dependence hook. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new scheduler dependencies lists. (resolve_dep): Remove. Move the logic to schedule_insn (). (init_h_i_d): Initialize dependencies lists. (process_insn_depend_be_in_spec): Rename to process_insn_forw_deps_be_in_spec. Update to use new scheduler dependencies lists. (add_to_speculative_block, create_check_block_twin, fix_recovery_deps): Update to use new scheduler dependencies lists. (clear_priorities, calc_priorities, add_jump_dependencies): Ditto. * ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use new scheduler dependencies lists. (build_intra_loop_deps): Ditto. * target.h (struct _dep): Declare to use in gcc_target.sched.is_costly_dependence. (struct gcc_target.sched.adjust_cost): Fix typo. (struct gcc_target.sched.is_costly_dependence): Change signature to use single dep_t parameter instead of an equivalent triad. (struct gcc_target.sched.adjust_cost_2): Remove. * target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove. * reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments. * doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update documentation. (TARGET_SCHED_ADJUST_COST_2): Remove documentation. * doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler. (REG_DEP_TRUE): Document. * config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost. Change signature to correspond to the targetm.sched.adjust_cost hook. Update use in TARGET_SCHED_ADJUST_COST_2. (TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST. (ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use new scheduler dependencies lists. (ia64_gen_check): Ditto. * config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler dependencies lists. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change signature to correspond to the targetm.sched.is_costly_dependence hook. (is_costly_group): Update to use new scheduler dependencies lists. * config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function instead of INSN_COST () macro. From-SVN: r121494
2007-02-02 10:11:11 +01:00
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
FOR_EACH_DEP (insn, SD_LIST_FORW, sd_it, dep)
{
enum attr_itanium_class c;
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
if (DEP_TYPE (dep) != REG_DEP_TRUE)
continue;
re PR middle-end/28071 (A file that can not be compiled in reasonable time/space) * sched-int.h (ds_to_dk, dk_to_ds): Declare functions. (struct _dep): New type. (dep_t): New typedef. (DEP_PRO, DEP_CON, DEP_KIND): New access macros. (DEP_STATUS): New access macro. The macro with the same name was renamed to DEP_LINK_STATUS. (dep_init): Declare function (struct _dep_link): New type. (dep_link_t): New typedef. (DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros. (DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros. (DEP_LINK_STATUS): New macro. (debug_dep_links): New debug function. (struct _deps_list): New type. (deps_list_t): New typedef. (DEPS_LIST_FIRST): New access macro. (FOR_EACH_DEP_LINK): New cycle macro. (create_deps_list, free_deps_list, delete_deps_list): Declare functions. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Ditto. (move_dep_link): Declare function. (struct _dep_node): New type. (dep_node_t): New typedef. (DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros. (struct haifa_insn_data.back_deps): New field to hold backward dependencies of the insn. (struct haifa_insn_data.depend): Rename to forw_deps. Change its type to deps_list_t. (struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps. Change its type to deps_list_t. (INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS. (INSN_DEPEND): Rename to INSN_FORW_DEPS. (RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS. (INSN_COST): Move to haifa-sched.c. Use insn_cost () instead. (DEP_STATUS): Rename to DEP_LINK_STATUS. Fix typo in the comment. (add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and all callers. (dep_cost): Declare. * sched-deps.c (CHECK): New macro to (en/dis)able sanity checks. (ds_to_dk, dk_to_ds): New functions. (init_dep_1): New static function. (init_dep): New function. (copy_dep): New static function. (dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static functions. (detach_dep_link): New static function. (move_dep_link): New function. (dep_links_consistent_p, dump_dep_links): New static functions. (debug_dep_links): New debugging function. (deps_obstack, dl_obstack, dn_obstack): New static variables. (alloc_deps_list, init_deps_list): New static functions. (create_deps_list): New function. (clear_deps_list): New static function. (free_deps_list, delete_deps_list, deps_list_empty_p): New functions. (deps_list_consistent_p, dump_deps_list): New static functions. (debug_deps_list): New function. (add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New functions. (find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to use new scheduler dependencies lists. (add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto. (sched_analyze): Ditto. Initialize dependencies lists. (add_forw_dep, compute_forward_dependences): Update to use new scheduler dependencies lists. (init_dependency_caches): Init deps_obstack. (free_dependency_caches): Free deps_obstack. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use new scheduler dependencies lists. (delete_forw_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. * sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree): Update to use new scheduler dependencies lists. (is_conditionally_protected, is_prisky, add_branch_dependences): Ditto. (debug_dependencies): Ditto. (schedule_region): Update comments. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new scheduler dependencies lists. (schedule_ebb): Update comments. * rtl.def (DEPS_LIST): Remove. * lists.c (unused_deps_list): Remove. (free_list): Update assertions. (alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * haifa-sched.c (comments): Update. (insn_cost1): Remove. Inline the code into insn_cost (). (insn_cost): Update to use new scheduler dependencies lists. Move processing of the dependency cost to dep_cost (). (dep_cost): New function. Use it instead of insn_cost () when evaluating cost of the dependency. Use compatible interface to interact with the target. (priority): Update to use new scheduler dependencies lists. (rank_for_schedule): Ditto. Optimize heuristic that prefers the insn with greater number of insns that depend on the insn. (schedule_insn): Update to use new scheduler dependencies lists. Add code to free backward dependencies lists. Inline and optimize code from resolve_dep () - see PR28071. (ok_for_early_queue_removal): Update to use new scheduler dependencies lists. Update call to targetm.sched.is_costly_dependence hook. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new scheduler dependencies lists. (resolve_dep): Remove. Move the logic to schedule_insn (). (init_h_i_d): Initialize dependencies lists. (process_insn_depend_be_in_spec): Rename to process_insn_forw_deps_be_in_spec. Update to use new scheduler dependencies lists. (add_to_speculative_block, create_check_block_twin, fix_recovery_deps): Update to use new scheduler dependencies lists. (clear_priorities, calc_priorities, add_jump_dependencies): Ditto. * ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use new scheduler dependencies lists. (build_intra_loop_deps): Ditto. * target.h (struct _dep): Declare to use in gcc_target.sched.is_costly_dependence. (struct gcc_target.sched.adjust_cost): Fix typo. (struct gcc_target.sched.is_costly_dependence): Change signature to use single dep_t parameter instead of an equivalent triad. (struct gcc_target.sched.adjust_cost_2): Remove. * target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove. * reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments. * doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update documentation. (TARGET_SCHED_ADJUST_COST_2): Remove documentation. * doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler. (REG_DEP_TRUE): Document. * config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost. Change signature to correspond to the targetm.sched.adjust_cost hook. Update use in TARGET_SCHED_ADJUST_COST_2. (TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST. (ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use new scheduler dependencies lists. (ia64_gen_check): Ditto. * config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler dependencies lists. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change signature to correspond to the targetm.sched.is_costly_dependence hook. (is_costly_group): Update to use new scheduler dependencies lists. * config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function instead of INSN_COST () macro. From-SVN: r121494
2007-02-02 10:11:11 +01:00
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
next = DEP_CON (dep);
c = ia64_safe_itanium_class (next);
if ((c == ITANIUM_CLASS_ST
|| c == ITANIUM_CLASS_STF)
&& ia64_st_address_bypass_p (insn, next))
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
{
has_mem_op_consumer_p = true;
break;
}
else if ((c == ITANIUM_CLASS_LD
|| c == ITANIUM_CLASS_FLD
|| c == ITANIUM_CLASS_FLDP)
&& ia64_ld_address_bypass_p (insn, next))
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
{
has_mem_op_consumer_p = true;
break;
}
}
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
insn->call = has_mem_op_consumer_p;
}
}
/* We're beginning a new block. Initialize data structures as necessary. */
static void
ia64_sched_init (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
int max_ready ATTRIBUTE_UNUSED)
{
#ifdef ENABLE_CHECKING
rtx insn;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (!sel_sched_p () && reload_completed)
for (insn = NEXT_INSN (current_sched_info->prev_head);
insn != current_sched_info->next_tail;
insn = NEXT_INSN (insn))
gcc_assert (!SCHED_GROUP_P (insn));
#endif
last_scheduled_insn = NULL_RTX;
init_insn_group_barriers ();
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
current_cycle = 0;
memset (mem_ops_in_group, 0, sizeof (mem_ops_in_group));
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* We're beginning a scheduling pass. Check assertion. */
static void
ia64_sched_init_global (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
int max_ready ATTRIBUTE_UNUSED)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (pending_data_specs == 0);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
/* Scheduling pass is now finished. Free/reset static variable. */
static void
ia64_sched_finish_global (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (pending_data_specs == 0);
}
/* Return TRUE if INSN is a load (either normal or speculative, but not a
speculation check), FALSE otherwise. */
static bool
is_load_p (rtx insn)
{
enum attr_itanium_class insn_class = ia64_safe_itanium_class (insn);
return
((insn_class == ITANIUM_CLASS_LD || insn_class == ITANIUM_CLASS_FLD)
&& get_attr_check_load (insn) == CHECK_LOAD_NO);
}
/* If INSN is a memory reference, memoize it in MEM_OPS_IN_GROUP global array
(taking account for 3-cycle cache reference postponing for stores: Intel
Itanium 2 Reference Manual for Software Development and Optimization,
6.7.3.1). */
static void
record_memory_reference (rtx insn)
{
enum attr_itanium_class insn_class = ia64_safe_itanium_class (insn);
switch (insn_class) {
case ITANIUM_CLASS_FLD:
case ITANIUM_CLASS_LD:
mem_ops_in_group[current_cycle % 4]++;
break;
case ITANIUM_CLASS_STF:
case ITANIUM_CLASS_ST:
mem_ops_in_group[(current_cycle + 3) % 4]++;
break;
default:;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
/* We are about to being issuing insns for this clock cycle.
Override the default sort algorithm to better slot instructions. */
static int
ia64_dfa_sched_reorder (FILE *dump, int sched_verbose, rtx *ready,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
int *pn_ready, int clock_var,
int reorder_type)
{
int n_asms;
int n_ready = *pn_ready;
rtx *e_ready = ready + n_ready;
rtx *insnp;
if (sched_verbose)
fprintf (dump, "// ia64_dfa_sched_reorder (type %d):\n", reorder_type);
if (reorder_type == 0)
{
/* First, move all USEs, CLOBBERs and other crud out of the way. */
n_asms = 0;
for (insnp = ready; insnp < e_ready; insnp++)
if (insnp < e_ready)
{
rtx insn = *insnp;
enum attr_type t = ia64_safe_type (insn);
if (t == TYPE_UNKNOWN)
{
if (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0)
{
rtx lowest = ready[n_asms];
ready[n_asms] = insn;
*insnp = lowest;
n_asms++;
}
else
{
rtx highest = ready[n_ready - 1];
ready[n_ready - 1] = insn;
*insnp = highest;
return 1;
}
}
}
if (n_asms < n_ready)
{
/* Some normal insns to process. Skip the asms. */
ready += n_asms;
n_ready -= n_asms;
}
else if (n_ready > 0)
return 1;
}
if (ia64_final_schedule)
{
int deleted = 0;
int nr_need_stop = 0;
for (insnp = ready; insnp < e_ready; insnp++)
if (safe_group_barrier_needed (*insnp))
nr_need_stop++;
if (reorder_type == 1 && n_ready == nr_need_stop)
return 0;
if (reorder_type == 0)
return 1;
insnp = e_ready;
/* Move down everything that needs a stop bit, preserving
relative order. */
while (insnp-- > ready + deleted)
while (insnp >= ready + deleted)
{
rtx insn = *insnp;
if (! safe_group_barrier_needed (insn))
break;
memmove (ready + 1, ready, (insnp - ready) * sizeof (rtx));
*ready = insn;
deleted++;
}
n_ready -= deleted;
ready += deleted;
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
current_cycle = clock_var;
if (reload_completed && mem_ops_in_group[clock_var % 4] >= ia64_max_memory_insns)
{
int moved = 0;
insnp = e_ready;
/* Move down loads/stores, preserving relative order. */
while (insnp-- > ready + moved)
while (insnp >= ready + moved)
{
rtx insn = *insnp;
if (! is_load_p (insn))
break;
memmove (ready + 1, ready, (insnp - ready) * sizeof (rtx));
*ready = insn;
moved++;
}
n_ready -= moved;
ready += moved;
}
return 1;
}
/* We are about to being issuing insns for this clock cycle. Override
the default sort algorithm to better slot instructions. */
2000-03-09 01:26:04 +01:00
static int
ia64_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, int *pn_ready,
int clock_var)
{
return ia64_dfa_sched_reorder (dump, sched_verbose, ready,
pn_ready, clock_var, 0);
}
/* Like ia64_sched_reorder, but called after issuing each insn.
Override the default sort algorithm to better slot instructions. */
static int
ia64_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED, rtx *ready,
int *pn_ready, int clock_var)
{
if (ia64_tune == PROCESSOR_ITANIUM && reload_completed && last_scheduled_insn)
clocks [INSN_UID (last_scheduled_insn)] = clock_var;
return ia64_dfa_sched_reorder (dump, sched_verbose, ready, pn_ready,
clock_var, 1);
}
/* We are about to issue INSN. Return the number of insns left on the
ready queue that can be issued this cycle. */
static int
ia64_variable_issue (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
rtx insn ATTRIBUTE_UNUSED,
int can_issue_more ATTRIBUTE_UNUSED)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (sched_deps_info->generate_spec_deps && !sel_sched_p ())
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* Modulo scheduling does not extend h_i_d when emitting
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
new instructions. Don't use h_i_d, if we don't have to. */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
if (DONE_SPEC (insn) & BEGIN_DATA)
pending_data_specs++;
if (CHECK_SPEC (insn) & BEGIN_DATA)
pending_data_specs--;
}
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
if (DEBUG_INSN_P (insn))
return 1;
last_scheduled_insn = insn;
memcpy (prev_cycle_state, curr_state, dfa_state_size);
if (reload_completed)
{
int needed = group_barrier_needed (insn);
gcc_assert (!needed);
if (GET_CODE (insn) == CALL_INSN)
init_insn_group_barriers ();
stops_p [INSN_UID (insn)] = stop_before_p;
stop_before_p = 0;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
record_memory_reference (insn);
}
return 1;
}
2000-03-09 01:26:04 +01:00
/* We are choosing insn from the ready queue. Return nonzero if INSN
can be chosen. */
2000-03-09 01:26:04 +01:00
static int
ia64_first_cycle_multipass_dfa_lookahead_guard (rtx insn)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (insn && INSN_P (insn));
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
return ((!reload_completed
|| !safe_group_barrier_needed (insn))
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
&& ia64_first_cycle_multipass_dfa_lookahead_guard_spec (insn)
&& (!mflag_sched_mem_insns_hard_limit
|| !is_load_p (insn)
|| mem_ops_in_group[current_cycle % 4] < ia64_max_memory_insns));
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
/* We are choosing insn from the ready queue. Return nonzero if INSN
can be chosen. */
static bool
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
ia64_first_cycle_multipass_dfa_lookahead_guard_spec (const_rtx insn)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
gcc_assert (insn && INSN_P (insn));
/* Size of ALAT is 32. As far as we perform conservative data speculation,
we keep ALAT half-empty. */
return (pending_data_specs < 16
|| !(TODO_SPEC (insn) & BEGIN_DATA));
}
/* The following variable value is pseudo-insn used by the DFA insn
scheduler to change the DFA state when the simulated clock is
increased. */
static rtx dfa_pre_cycle_insn;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Returns 1 when a meaningful insn was scheduled between the last group
barrier and LAST. */
static int
scheduled_good_insn (rtx last)
{
if (last && recog_memoized (last) >= 0)
return 1;
for ( ;
last != NULL && !NOTE_INSN_BASIC_BLOCK_P (last)
&& !stops_p[INSN_UID (last)];
last = PREV_INSN (last))
/* We could hit a NOTE_INSN_DELETED here which is actually outside
the ebb we're scheduling. */
if (INSN_P (last) && recog_memoized (last) >= 0)
return 1;
return 0;
}
/* We are about to being issuing INSN. Return nonzero if we cannot
issue it on given cycle CLOCK and return zero if we should not sort
the ready queue on the next clock start. */
static int
ia64_dfa_new_cycle (FILE *dump, int verbose, rtx insn, int last_clock,
int clock, int *sort_p)
{
int setup_clocks_p = FALSE;
gcc_assert (insn && INSN_P (insn));
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
if (DEBUG_INSN_P (insn))
return 0;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* When a group barrier is needed for insn, last_scheduled_insn
should be set. */
gcc_assert (!(reload_completed && safe_group_barrier_needed (insn))
|| last_scheduled_insn);
if ((reload_completed
&& (safe_group_barrier_needed (insn)
|| (mflag_sched_stop_bits_after_every_cycle
&& last_clock != clock
&& last_scheduled_insn
&& scheduled_good_insn (last_scheduled_insn))))
|| (last_scheduled_insn
&& (GET_CODE (last_scheduled_insn) == CALL_INSN
|| GET_CODE (PATTERN (last_scheduled_insn)) == ASM_INPUT
|| asm_noperands (PATTERN (last_scheduled_insn)) >= 0)))
{
init_insn_group_barriers ();
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (verbose && dump)
fprintf (dump, "// Stop should be before %d%s\n", INSN_UID (insn),
last_clock == clock ? " + cycle advance" : "");
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
stop_before_p = 1;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
current_cycle = clock;
mem_ops_in_group[current_cycle % 4] = 0;
if (last_clock == clock)
{
state_transition (curr_state, dfa_stop_insn);
if (TARGET_EARLY_STOP_BITS)
*sort_p = (last_scheduled_insn == NULL_RTX
|| GET_CODE (last_scheduled_insn) != CALL_INSN);
else
*sort_p = 0;
return 1;
}
else if (reload_completed)
setup_clocks_p = TRUE;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (last_scheduled_insn)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (GET_CODE (PATTERN (last_scheduled_insn)) == ASM_INPUT
|| asm_noperands (PATTERN (last_scheduled_insn)) >= 0)
state_reset (curr_state);
else
{
memcpy (curr_state, prev_cycle_state, dfa_state_size);
state_transition (curr_state, dfa_stop_insn);
state_transition (curr_state, dfa_pre_cycle_insn);
state_transition (curr_state, NULL);
}
}
}
else if (reload_completed)
setup_clocks_p = TRUE;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (setup_clocks_p && ia64_tune == PROCESSOR_ITANIUM
&& GET_CODE (PATTERN (insn)) != ASM_INPUT
&& asm_noperands (PATTERN (insn)) < 0)
{
enum attr_itanium_class c = ia64_safe_itanium_class (insn);
if (c != ITANIUM_CLASS_MMMUL && c != ITANIUM_CLASS_MMSHF)
{
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
sd_iterator_def sd_it;
dep_t dep;
int d = -1;
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
FOR_EACH_DEP (insn, SD_LIST_BACK, sd_it, dep)
if (DEP_TYPE (dep) == REG_DEP_TRUE)
{
enum attr_itanium_class dep_class;
sched-int.h (struct _dep): Rename field 'kind' to 'type'. * sched-int.h (struct _dep): Rename field 'kind' to 'type'. (DEP_KIND): Rename to DEP_TYPE. Update all uses. (dep_def): New typedef. (init_dep_1, sd_debug_dep): Declare functions. (DEP_LINK_KIND): Rename to DEP_LINK_TYPE. (debug_dep_links): Remove. (struct _deps_list): New field 'n_links'. (DEPS_LIST_N_LINKS): New macro. (FOR_EACH_DEP_LINK): Remove. (create_deps_list, free_deps_list, delete_deps_list): Remove declaration. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con, move_dep_link): Ditto. (struct haifa_insn_data): Split field 'back_deps' into 'hard_back_deps' and 'spec_back_deps'. New field 'resolved_forw_deps'. Remove field 'dep_count'. (INSN_BACK_DEPS): Remove. (INSN_HARD_BACK_DEPS, INSN_SPEC_BACK_DEPS, INSN_RESOLVED_FORW_DEPS): New macros. (INSN_DEP_COUNT): Remove. (enum DEPS_ADJUST_RESULT): Add new constant DEP_NODEP. Fix comments. (spec_info, haifa_recovery_block_was_added_during_scheduling_p): Declare global variables. (deps_pools_are_empty_p, sched_free_deps): Declare functions. (add_forw_dep, compute_forward_dependences): Remove declarations. (add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (debug_ds, sched_insn_is_legitimate_for_speculation_p): Declare functions. (SD_LIST_NONE, SD_LIST_HARD_BACK, SD_LIST_SPEC_BACK, SD_LIST_FORW): New constants. (SD_LIST_RES_BACK, SD_LIST_RES_FORW, SD_LIST_BACK): Ditto. (sd_list_types_def): New typedef. (sd_next_list): Declare function. (struct _sd_iterator): New type. (sd_iterator_def): New typedef. (sd_iterator_start, sd_iterator_cond, sd_iterator_next): New inline functions. (FOR_EACH_DEP): New cycle wrapper. (sd_lists_size, sd_lists_empty_p, sd_init_insn, sd_finish_insn): Declare functions. (sd_find_dep_between, sd_add_dep, sd_add_or_update_dep): Ditto. (sd_resolve_dep, sd_copy_back_deps, sd_delete_dep, sd_debug_lists): Ditto. * sched-deps.c (init_dep_1): Make global. (DUMP_DEP_PRO, DUMP_DEP_CON, DUMP_DEP_STATUS, DUMP_DEP_ALL): New constants. (dump_dep): New static function. (dump_dep_flags): New static variable. (sd_debug_dep): New function. (add_to_deps_list, remove_from_deps_list): Update 'n_links' field of the list. (move_dep_link): Use remove_from_deps_list (), instead of detach_dep_link (). (dep_links_consistent_p, dump_dep_links, debug_dep_links): Remove. (dep_link_is_detached_p): New static function. (deps_obstack, dl_obstack, dn_obstack): Remove. Use dn_pool, dl_pool instead. (dn_pool, dl_pool): New alloc_pools. (dn_pool_diff, dl_pool_diff): New static variables. (create_dep_node, delete_dep_node): New static function. (create_deps_list): Make it static. Use alloc_pool 'dl_pool'. (deps_list_empty_p): Make it static. Use 'n_links' field. (deps_pools_are_empty_p): New static function. (alloc_deps_list, delete_deps_list): Remove. (dump_deps_list, debug_deps_list, add_back_dep_to_deps_list): Remove. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Remove. Use sd_copy_back_deps () instead. (forward_dependency_cache): Remove. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Remove 'back' from the names. Change signature to use dep_t instead of equivalent quad. (add_back_dep): Ditto. Make global. (check_dep_status): Rename to check_dep (). (sd_next_list, sd_lists_size, sd_lists_empty_p, sd_init_insn): New functions. (sd_finish_insn): Ditto. (sd_find_dep_between_no_cache): New static function. (sd_find_dep_between): New function. (ask_dependency_caches, set_dependency_caches): New static functions. (update_dependency_caches, change_spec_dep_to_hard, update_dep): Ditto. (add_or_update_dep_1): Separate pieces of functionality into ask_dependency_caches (), update_dependency_caches (), change_spec_dep_to_hard (), update_dep (). (get_back_and_forw_lists): New static function. (sd_add_dep): Separate setting of dependency caches into set_dependency_caches (). (sd_add_or_update_dep, sd_resolve_dep, sd_copy_back_deps): New functions. (sd_delete_dep): Ditto. (DUMP_LISTS_SIZE, DUMP_LISTS_DEPS, DUMP_LISTS_ALL): New constants. (dump_lists): New static function. (sd_debug_lists): New debug function. (delete_all_dependences, fixup_sched_groups): Update to use sd_* infrastructure. (sched_analyze_2): Create data-speculative dependency only if data-speculation is enabled. (sched_analyze_insn): If insn cannot be speculative, make all its dependencies non-speculative. (sched_analyze): Use sd_init_insn (). (add_forw_dep, compute_forward_dependencies): Remove. (delete_dep_nodes_in_back_deps): New static function. (sched_free_deps): New function. (init_dependency_caches): Init alloc_pools. (extend_depedency_caches): Update after removing of forward_dependency_cache. (free_dependency_caches): Ditto. Free alloc_pools. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Remove. (delete_forw_dep, add_or_update_back_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. (add_dependence): Use init_dep (). (get_dep_weak_1): New static function. (get_dep_weak): Move logic to get_dep_weak_1 (). (dump_ds): New static function moved from haifa-sched.c: debug_spec_status (). (debug_ds): New debug function. (check_dep_status): Rename to check_dep (). Update to check whole dependencies. * haifa-sched.c (spec_info): Make global. (added_recovery_block_p): Rename to 'haifa_recovery_block_was_added_during_current_schedule_block_p'. (haifa_recovery_block_was_added_during_scheduling_p): New variable. (dep_cost, priority, rank_for_schedule, schedule_insn): Update to use new interfaces. (ok_for_early_queue_removal): Ditto. (schedule_block): Initialize logical uids of insns emitted by the target. (sched_init): Initialize new variable. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new interfaces. (extend_global): Initialize insn data. (init_h_i_d): Remove code that is now handled in sd_init_insn (). (process_insn_forw_deps_be_in_spec): Change signature. Update to use new interfaces. (add_to_speculative_block): Update to use new interfaces. (create_recovery_block): Set new variables. (create_check_block_twin, fix_recovery_deps): Update to use new interfaces. (sched_insn_is_legitimate_for_speculation_p): New function. (speculate_insn): Move checking logic to sched_insn_is_legitimate_for_speculation_p (). (sched_remove_insn): Finalize sched-deps information of instruction. (clear_priorities, add_jump_dependencies): Update to use new interfaces. (debug_spec_status): Rename to dump_ds () and move to sched-deps.c. * sched-rgn.c (set_spec_fed, find_conditional_protection): Update to use new interfaces. (is_conditionally_protected, is_pfree, is_prisky) Ditto. (new_ready): Try to use control speculation only if it is available. (add_branch_dependences): Update to use new interfaces. (compute_block_backward_dependences): Rename to compute_block_dependences (). Call targetm.sched.dependencies_evaluation_hook (). (free_block_dependencies): New static function. (debug_dependencies): Update to use new interfaces. (schedule_region): Remove separate computation of forward dependencies. Move call of targetm.sched.dependencies_evaluation_hook () to compute_block_dependences (). Free dependencies at the end of scheduling the region. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new interfaces. (add_deps_for_risky_insns): Ditto. (schedule_ebb): Remove separate computation of forward dependencies. Free dependencies at the end of scheduling the ebb. * ddg.c (create_ddg_dependence): Update to use new interfaces. (build_intra_loop_deps): Ditto. Remove separate computation of forward dependencies. Free sched-deps dependencies. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Update to use new interfaces. (ia64_dfa_new_cycle, ia64_gen_check): Ditto. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Update to use new interfaces. (is_costly_group): Ditto. From-SVN: r127405
2007-08-14 08:40:34 +02:00
rtx dep_insn = DEP_PRO (dep);
dep_class = ia64_safe_itanium_class (dep_insn);
if ((dep_class == ITANIUM_CLASS_MMMUL
|| dep_class == ITANIUM_CLASS_MMSHF)
&& last_clock - clocks [INSN_UID (dep_insn)] < 4
&& (d < 0
|| last_clock - clocks [INSN_UID (dep_insn)] < d))
d = last_clock - clocks [INSN_UID (dep_insn)];
}
if (d >= 0)
add_cycles [INSN_UID (insn)] = 3 - d;
}
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
return 0;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* Implement targetm.sched.h_i_d_extended hook.
Extend internal data structures. */
static void
ia64_h_i_d_extended (void)
{
if (stops_p != NULL)
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
int new_clocks_length = get_max_uid () * 3 / 2;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
stops_p = (char *) xrecalloc (stops_p, new_clocks_length, clocks_length, 1);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (ia64_tune == PROCESSOR_ITANIUM)
{
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
clocks = (int *) xrecalloc (clocks, new_clocks_length, clocks_length,
sizeof (int));
add_cycles = (int *) xrecalloc (add_cycles, new_clocks_length,
clocks_length, sizeof (int));
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
clocks_length = new_clocks_length;
}
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* This structure describes the data used by the backend to guide scheduling.
When the current scheduling point is switched, this data should be saved
and restored later, if the scheduler returns to this point. */
struct _ia64_sched_context
{
state_t prev_cycle_state;
rtx last_scheduled_insn;
struct reg_write_state rws_sum[NUM_REGS];
struct reg_write_state rws_insn[NUM_REGS];
int first_instruction;
int pending_data_specs;
int current_cycle;
char mem_ops_in_group[4];
};
typedef struct _ia64_sched_context *ia64_sched_context_t;
/* Allocates a scheduling context. */
static void *
ia64_alloc_sched_context (void)
{
return xmalloc (sizeof (struct _ia64_sched_context));
}
/* Initializes the _SC context with clean data, if CLEAN_P, and from
the global context otherwise. */
static void
ia64_init_sched_context (void *_sc, bool clean_p)
{
ia64_sched_context_t sc = (ia64_sched_context_t) _sc;
sc->prev_cycle_state = xmalloc (dfa_state_size);
if (clean_p)
{
state_reset (sc->prev_cycle_state);
sc->last_scheduled_insn = NULL_RTX;
memset (sc->rws_sum, 0, sizeof (rws_sum));
memset (sc->rws_insn, 0, sizeof (rws_insn));
sc->first_instruction = 1;
sc->pending_data_specs = 0;
sc->current_cycle = 0;
memset (sc->mem_ops_in_group, 0, sizeof (mem_ops_in_group));
}
else
{
memcpy (sc->prev_cycle_state, prev_cycle_state, dfa_state_size);
sc->last_scheduled_insn = last_scheduled_insn;
memcpy (sc->rws_sum, rws_sum, sizeof (rws_sum));
memcpy (sc->rws_insn, rws_insn, sizeof (rws_insn));
sc->first_instruction = first_instruction;
sc->pending_data_specs = pending_data_specs;
sc->current_cycle = current_cycle;
memcpy (sc->mem_ops_in_group, mem_ops_in_group, sizeof (mem_ops_in_group));
}
}
/* Sets the global scheduling context to the one pointed to by _SC. */
static void
ia64_set_sched_context (void *_sc)
{
ia64_sched_context_t sc = (ia64_sched_context_t) _sc;
gcc_assert (sc != NULL);
memcpy (prev_cycle_state, sc->prev_cycle_state, dfa_state_size);
last_scheduled_insn = sc->last_scheduled_insn;
memcpy (rws_sum, sc->rws_sum, sizeof (rws_sum));
memcpy (rws_insn, sc->rws_insn, sizeof (rws_insn));
first_instruction = sc->first_instruction;
pending_data_specs = sc->pending_data_specs;
current_cycle = sc->current_cycle;
memcpy (mem_ops_in_group, sc->mem_ops_in_group, sizeof (mem_ops_in_group));
}
/* Clears the data in the _SC scheduling context. */
static void
ia64_clear_sched_context (void *_sc)
{
ia64_sched_context_t sc = (ia64_sched_context_t) _sc;
free (sc->prev_cycle_state);
sc->prev_cycle_state = NULL;
}
/* Frees the _SC scheduling context. */
static void
ia64_free_sched_context (void *_sc)
{
gcc_assert (_sc != NULL);
free (_sc);
}
typedef rtx (* gen_func_t) (rtx, rtx);
/* Return a function that will generate a load of mode MODE_NO
with speculation types TS. */
static gen_func_t
get_spec_load_gen_function (ds_t ts, int mode_no)
{
static gen_func_t gen_ld_[] = {
gen_movbi,
gen_movqi_internal,
gen_movhi_internal,
gen_movsi_internal,
gen_movdi_internal,
gen_movsf_internal,
gen_movdf_internal,
gen_movxf_internal,
gen_movti_internal,
gen_zero_extendqidi2,
gen_zero_extendhidi2,
gen_zero_extendsidi2,
};
static gen_func_t gen_ld_a[] = {
gen_movbi_advanced,
gen_movqi_advanced,
gen_movhi_advanced,
gen_movsi_advanced,
gen_movdi_advanced,
gen_movsf_advanced,
gen_movdf_advanced,
gen_movxf_advanced,
gen_movti_advanced,
gen_zero_extendqidi2_advanced,
gen_zero_extendhidi2_advanced,
gen_zero_extendsidi2_advanced,
};
static gen_func_t gen_ld_s[] = {
gen_movbi_speculative,
gen_movqi_speculative,
gen_movhi_speculative,
gen_movsi_speculative,
gen_movdi_speculative,
gen_movsf_speculative,
gen_movdf_speculative,
gen_movxf_speculative,
gen_movti_speculative,
gen_zero_extendqidi2_speculative,
gen_zero_extendhidi2_speculative,
gen_zero_extendsidi2_speculative,
};
static gen_func_t gen_ld_sa[] = {
gen_movbi_speculative_advanced,
gen_movqi_speculative_advanced,
gen_movhi_speculative_advanced,
gen_movsi_speculative_advanced,
gen_movdi_speculative_advanced,
gen_movsf_speculative_advanced,
gen_movdf_speculative_advanced,
gen_movxf_speculative_advanced,
gen_movti_speculative_advanced,
gen_zero_extendqidi2_speculative_advanced,
gen_zero_extendhidi2_speculative_advanced,
gen_zero_extendsidi2_speculative_advanced,
};
static gen_func_t gen_ld_s_a[] = {
gen_movbi_speculative_a,
gen_movqi_speculative_a,
gen_movhi_speculative_a,
gen_movsi_speculative_a,
gen_movdi_speculative_a,
gen_movsf_speculative_a,
gen_movdf_speculative_a,
gen_movxf_speculative_a,
gen_movti_speculative_a,
gen_zero_extendqidi2_speculative_a,
gen_zero_extendhidi2_speculative_a,
gen_zero_extendsidi2_speculative_a,
};
gen_func_t *gen_ld;
if (ts & BEGIN_DATA)
{
if (ts & BEGIN_CONTROL)
gen_ld = gen_ld_sa;
else
gen_ld = gen_ld_a;
}
else if (ts & BEGIN_CONTROL)
{
if ((spec_info->flags & SEL_SCHED_SPEC_DONT_CHECK_CONTROL)
|| ia64_needs_block_p (ts))
gen_ld = gen_ld_s;
else
gen_ld = gen_ld_s_a;
}
else if (ts == 0)
gen_ld = gen_ld_;
else
gcc_unreachable ();
return gen_ld[mode_no];
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* Constants that help mapping 'enum machine_mode' to int. */
enum SPEC_MODES
{
SPEC_MODE_INVALID = -1,
SPEC_MODE_FIRST = 0,
SPEC_MODE_FOR_EXTEND_FIRST = 1,
SPEC_MODE_FOR_EXTEND_LAST = 3,
SPEC_MODE_LAST = 8
};
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
enum
{
/* Offset to reach ZERO_EXTEND patterns. */
SPEC_GEN_EXTEND_OFFSET = SPEC_MODE_LAST - SPEC_MODE_FOR_EXTEND_FIRST + 1
};
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* Return index of the MODE. */
static int
ia64_mode_to_int (enum machine_mode mode)
{
switch (mode)
{
case BImode: return 0; /* SPEC_MODE_FIRST */
case QImode: return 1; /* SPEC_MODE_FOR_EXTEND_FIRST */
case HImode: return 2;
case SImode: return 3; /* SPEC_MODE_FOR_EXTEND_LAST */
case DImode: return 4;
case SFmode: return 5;
case DFmode: return 6;
case XFmode: return 7;
case TImode:
/* ??? This mode needs testing. Bypasses for ldfp8 instruction are not
mentioned in itanium[12].md. Predicate fp_register_operand also
needs to be defined. Bottom line: better disable for now. */
return SPEC_MODE_INVALID;
default: return SPEC_MODE_INVALID;
}
}
/* Provide information about speculation capabilities. */
static void
ia64_set_sched_flags (spec_info_t spec_info)
{
unsigned int *flags = &(current_sched_info->flags);
if (*flags & SCHED_RGN
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
|| *flags & SCHED_EBB
|| *flags & SEL_SCHED)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
int mask = 0;
if ((mflag_sched_br_data_spec && !reload_completed && optimize > 0)
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
|| (mflag_sched_ar_data_spec && reload_completed))
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
mask |= BEGIN_DATA;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (!sel_sched_p ()
&& ((mflag_sched_br_in_data_spec && !reload_completed)
|| (mflag_sched_ar_in_data_spec && reload_completed)))
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
mask |= BE_IN_DATA;
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (mflag_sched_control_spec
&& (!sel_sched_p ()
|| reload_completed))
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
mask |= BEGIN_CONTROL;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (!sel_sched_p () && mflag_sched_in_control_spec)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
mask |= BE_IN_CONTROL;
}
spec_info->mask = mask;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (mask)
{
*flags |= USE_DEPS_LIST | DO_SPECULATION;
if (mask & BE_IN_SPEC)
*flags |= NEW_BBS;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
spec_info->flags = 0;
if ((mask & DATA_SPEC) && mflag_sched_prefer_non_data_spec_insns)
spec_info->flags |= PREFER_NON_DATA_SPEC;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (mask & CONTROL_SPEC)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (mflag_sched_prefer_non_control_spec_insns)
spec_info->flags |= PREFER_NON_CONTROL_SPEC;
if (sel_sched_p () && mflag_sel_sched_dont_check_control_spec)
spec_info->flags |= SEL_SCHED_SPEC_DONT_CHECK_CONTROL;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (sched_verbose >= 1)
spec_info->dump = sched_dump;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
else
spec_info->dump = 0;
if (mflag_sched_count_spec_in_critical_path)
spec_info->flags |= COUNT_SPEC_IN_CRITICAL_PATH;
}
}
else
spec_info->mask = 0;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* If INSN is an appropriate load return its mode.
Return -1 otherwise. */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
static int
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
get_mode_no_for_insn (rtx insn)
{
rtx reg, mem, mode_rtx;
int mode_no;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
bool extend_p;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
extract_insn_cached (insn);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* We use WHICH_ALTERNATIVE only after reload. This will
guarantee that reload won't touch a speculative insn. */
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (recog_data.n_operands != 2)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
return -1;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
reg = recog_data.operand[0];
mem = recog_data.operand[1];
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* We should use MEM's mode since REG's mode in presence of
ZERO_EXTEND will always be DImode. */
if (get_attr_speculable1 (insn) == SPECULABLE1_YES)
/* Process non-speculative ld. */
{
if (!reload_completed)
{
/* Do not speculate into regs like ar.lc. */
if (!REG_P (reg) || AR_REGNO_P (REGNO (reg)))
return -1;
if (!MEM_P (mem))
return -1;
{
rtx mem_reg = XEXP (mem, 0);
if (!REG_P (mem_reg))
return -1;
}
mode_rtx = mem;
}
else if (get_attr_speculable2 (insn) == SPECULABLE2_YES)
{
gcc_assert (REG_P (reg) && MEM_P (mem));
mode_rtx = mem;
}
else
return -1;
}
else if (get_attr_data_speculative (insn) == DATA_SPECULATIVE_YES
|| get_attr_control_speculative (insn) == CONTROL_SPECULATIVE_YES
|| get_attr_check_load (insn) == CHECK_LOAD_YES)
/* Process speculative ld or ld.c. */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (REG_P (reg) && MEM_P (mem));
mode_rtx = mem;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
else
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
enum attr_itanium_class attr_class = get_attr_itanium_class (insn);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (attr_class == ITANIUM_CLASS_CHK_A
|| attr_class == ITANIUM_CLASS_CHK_S_I
|| attr_class == ITANIUM_CLASS_CHK_S_F)
/* Process chk. */
mode_rtx = reg;
else
return -1;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
mode_no = ia64_mode_to_int (GET_MODE (mode_rtx));
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (mode_no == SPEC_MODE_INVALID)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
return -1;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
extend_p = (GET_MODE (reg) != GET_MODE (mode_rtx));
if (extend_p)
{
if (!(SPEC_MODE_FOR_EXTEND_FIRST <= mode_no
&& mode_no <= SPEC_MODE_FOR_EXTEND_LAST))
return -1;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
mode_no += SPEC_GEN_EXTEND_OFFSET;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
return mode_no;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* If X is an unspec part of a speculative load, return its code.
Return -1 otherwise. */
static int
get_spec_unspec_code (const_rtx x)
{
if (GET_CODE (x) != UNSPEC)
return -1;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
int code;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
code = XINT (x, 1);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
switch (code)
{
case UNSPEC_LDA:
case UNSPEC_LDS:
case UNSPEC_LDS_A:
case UNSPEC_LDSA:
return code;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
default:
return -1;
}
}
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Implement skip_rtx_p hook. */
static bool
ia64_skip_rtx_p (const_rtx x)
{
return get_spec_unspec_code (x) != -1;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* If INSN is a speculative load, return its UNSPEC code.
Return -1 otherwise. */
static int
get_insn_spec_code (const_rtx insn)
{
rtx pat, reg, mem;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
pat = PATTERN (insn);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (GET_CODE (pat) == COND_EXEC)
pat = COND_EXEC_CODE (pat);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (GET_CODE (pat) != SET)
return -1;
reg = SET_DEST (pat);
if (!REG_P (reg))
return -1;
mem = SET_SRC (pat);
if (GET_CODE (mem) == ZERO_EXTEND)
mem = XEXP (mem, 0);
return get_spec_unspec_code (mem);
}
/* If INSN is a speculative load, return a ds with the speculation types.
Otherwise [if INSN is a normal instruction] return 0. */
static ds_t
ia64_get_insn_spec_ds (rtx insn)
{
int code = get_insn_spec_code (insn);
switch (code)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
case UNSPEC_LDA:
return BEGIN_DATA;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
case UNSPEC_LDS:
case UNSPEC_LDS_A:
return BEGIN_CONTROL;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
case UNSPEC_LDSA:
return BEGIN_DATA | BEGIN_CONTROL;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
default:
return 0;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
}
/* If INSN is a speculative load return a ds with the speculation types that
will be checked.
Otherwise [if INSN is a normal instruction] return 0. */
static ds_t
ia64_get_insn_checked_ds (rtx insn)
{
int code = get_insn_spec_code (insn);
switch (code)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
case UNSPEC_LDA:
return BEGIN_DATA | BEGIN_CONTROL;
case UNSPEC_LDS:
return BEGIN_CONTROL;
case UNSPEC_LDS_A:
case UNSPEC_LDSA:
return BEGIN_DATA | BEGIN_CONTROL;
default:
return 0;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* If GEN_P is true, calculate the index of needed speculation check and return
speculative pattern for INSN with speculative mode TS, machine mode
MODE_NO and with ZERO_EXTEND (if EXTEND_P is true).
If GEN_P is false, just calculate the index of needed speculation check. */
static rtx
ia64_gen_spec_load (rtx insn, ds_t ts, int mode_no)
{
rtx pat, new_pat;
gen_func_t gen_load;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gen_load = get_spec_load_gen_function (ts, mode_no);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
new_pat = gen_load (copy_rtx (recog_data.operand[0]),
copy_rtx (recog_data.operand[1]));
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
pat = PATTERN (insn);
if (GET_CODE (pat) == COND_EXEC)
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
new_pat = gen_rtx_COND_EXEC (VOIDmode, copy_rtx (COND_EXEC_TEST (pat)),
new_pat);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
return new_pat;
}
static bool
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
insn_can_be_in_speculative_p (rtx insn ATTRIBUTE_UNUSED,
ds_t ds ATTRIBUTE_UNUSED)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
return false;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Implement targetm.sched.speculate_insn hook.
Check if the INSN can be TS speculative.
If 'no' - return -1.
If 'yes' - generate speculative pattern in the NEW_PAT and return 1.
If current pattern of the INSN already provides TS speculation,
return 0. */
static int
ia64_speculate_insn (rtx insn, ds_t ts, rtx *new_pat)
{
int mode_no;
int res;
gcc_assert (!(ts & ~SPECULATIVE));
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (ia64_spec_check_p (insn))
return -1;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if ((ts & BE_IN_SPEC)
&& !insn_can_be_in_speculative_p (insn, ts))
return -1;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
mode_no = get_mode_no_for_insn (insn);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (mode_no != SPEC_MODE_INVALID)
{
if (ia64_get_insn_spec_ds (insn) == ds_get_speculation_types (ts))
res = 0;
else
{
res = 1;
*new_pat = ia64_gen_spec_load (insn, ts, mode_no);
}
}
else
res = -1;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
return res;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* Return a function that will generate a check for speculation TS with mode
MODE_NO.
If simple check is needed, pass true for SIMPLE_CHECK_P.
If clearing check is needed, pass true for CLEARING_CHECK_P. */
static gen_func_t
get_spec_check_gen_function (ds_t ts, int mode_no,
bool simple_check_p, bool clearing_check_p)
{
static gen_func_t gen_ld_c_clr[] = {
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
gen_movbi_clr,
gen_movqi_clr,
gen_movhi_clr,
gen_movsi_clr,
gen_movdi_clr,
gen_movsf_clr,
gen_movdf_clr,
gen_movxf_clr,
gen_movti_clr,
gen_zero_extendqidi2_clr,
gen_zero_extendhidi2_clr,
gen_zero_extendsidi2_clr,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
};
static gen_func_t gen_ld_c_nc[] = {
gen_movbi_nc,
gen_movqi_nc,
gen_movhi_nc,
gen_movsi_nc,
gen_movdi_nc,
gen_movsf_nc,
gen_movdf_nc,
gen_movxf_nc,
gen_movti_nc,
gen_zero_extendqidi2_nc,
gen_zero_extendhidi2_nc,
gen_zero_extendsidi2_nc,
};
static gen_func_t gen_chk_a_clr[] = {
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
gen_advanced_load_check_clr_bi,
gen_advanced_load_check_clr_qi,
gen_advanced_load_check_clr_hi,
gen_advanced_load_check_clr_si,
gen_advanced_load_check_clr_di,
gen_advanced_load_check_clr_sf,
gen_advanced_load_check_clr_df,
gen_advanced_load_check_clr_xf,
gen_advanced_load_check_clr_ti,
gen_advanced_load_check_clr_di,
gen_advanced_load_check_clr_di,
gen_advanced_load_check_clr_di,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
};
static gen_func_t gen_chk_a_nc[] = {
gen_advanced_load_check_nc_bi,
gen_advanced_load_check_nc_qi,
gen_advanced_load_check_nc_hi,
gen_advanced_load_check_nc_si,
gen_advanced_load_check_nc_di,
gen_advanced_load_check_nc_sf,
gen_advanced_load_check_nc_df,
gen_advanced_load_check_nc_xf,
gen_advanced_load_check_nc_ti,
gen_advanced_load_check_nc_di,
gen_advanced_load_check_nc_di,
gen_advanced_load_check_nc_di,
};
static gen_func_t gen_chk_s[] = {
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
gen_speculation_check_bi,
gen_speculation_check_qi,
gen_speculation_check_hi,
gen_speculation_check_si,
gen_speculation_check_di,
gen_speculation_check_sf,
gen_speculation_check_df,
gen_speculation_check_xf,
gen_speculation_check_ti,
gen_speculation_check_di,
gen_speculation_check_di,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gen_speculation_check_di,
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
};
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gen_func_t *gen_check;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (ts & BEGIN_DATA)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* We don't need recovery because even if this is ld.sa
ALAT entry will be allocated only if NAT bit is set to zero.
So it is enough to use ld.c here. */
if (simple_check_p)
{
gcc_assert (mflag_sched_spec_ldc);
if (clearing_check_p)
gen_check = gen_ld_c_clr;
else
gen_check = gen_ld_c_nc;
}
else
{
if (clearing_check_p)
gen_check = gen_chk_a_clr;
else
gen_check = gen_chk_a_nc;
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
else if (ts & BEGIN_CONTROL)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (simple_check_p)
/* We might want to use ld.sa -> ld.c instead of
ld.s -> chk.s. */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (!ia64_needs_block_p (ts));
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (clearing_check_p)
gen_check = gen_ld_c_clr;
else
gen_check = gen_ld_c_nc;
}
else
{
gen_check = gen_chk_s;
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
}
else
gcc_unreachable ();
gcc_assert (mode_no >= 0);
return gen_check[mode_no];
}
/* Return nonzero, if INSN needs branchy recovery check. */
static bool
ia64_needs_block_p (ds_t ts)
{
if (ts & BEGIN_DATA)
return !mflag_sched_spec_ldc;
gcc_assert ((ts & BEGIN_CONTROL) != 0);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
return !(mflag_sched_spec_control_ldc && mflag_sched_spec_ldc);
}
/* Generate (or regenerate, if (MUTATE_P)) recovery check for INSN.
If (LABEL != 0 || MUTATE_P), generate branchy recovery check.
Otherwise, generate a simple check. */
static rtx
ia64_gen_spec_check (rtx insn, rtx label, ds_t ds)
{
rtx op1, pat, check_pat;
gen_func_t gen_check;
int mode_no;
mode_no = get_mode_no_for_insn (insn);
gcc_assert (mode_no >= 0);
if (label)
op1 = label;
else
{
gcc_assert (!ia64_needs_block_p (ds));
op1 = copy_rtx (recog_data.operand[1]);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gen_check = get_spec_check_gen_function (ds, mode_no, label == NULL_RTX,
true);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
check_pat = gen_check (copy_rtx (recog_data.operand[0]), op1);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
pat = PATTERN (insn);
if (GET_CODE (pat) == COND_EXEC)
check_pat = gen_rtx_COND_EXEC (VOIDmode, copy_rtx (COND_EXEC_TEST (pat)),
check_pat);
return check_pat;
}
/* Return nonzero, if X is branchy recovery check. */
static int
ia64_spec_check_p (rtx x)
{
x = PATTERN (x);
if (GET_CODE (x) == COND_EXEC)
x = COND_EXEC_CODE (x);
if (GET_CODE (x) == SET)
return ia64_spec_check_src_p (SET_SRC (x));
return 0;
}
/* Return nonzero, if SRC belongs to recovery check. */
static int
ia64_spec_check_src_p (rtx src)
{
if (GET_CODE (src) == IF_THEN_ELSE)
{
rtx t;
t = XEXP (src, 0);
if (GET_CODE (t) == NE)
{
t = XEXP (t, 0);
if (GET_CODE (t) == UNSPEC)
{
int code;
code = XINT (t, 1);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (code == UNSPEC_LDCCLR
|| code == UNSPEC_LDCNC
|| code == UNSPEC_CHKACLR
|| code == UNSPEC_CHKANC
|| code == UNSPEC_CHKS)
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
gcc_assert (code != 0);
return code;
}
}
}
}
return 0;
}
/* The following page contains abstract data `bundle states' which are
used for bundling insns (inserting nops and template generation). */
/* The following describes state of insn bundling. */
struct bundle_state
{
/* Unique bundle state number to identify them in the debugging
output */
int unique_num;
rtx insn; /* corresponding insn, NULL for the 1st and the last state */
/* number nops before and after the insn */
short before_nops_num, after_nops_num;
int insn_num; /* insn number (0 - for initial state, 1 - for the 1st
insn */
int cost; /* cost of the state in cycles */
int accumulated_insns_num; /* number of all previous insns including
nops. L is considered as 2 insns */
int branch_deviation; /* deviation of previous branches from 3rd slots */
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
int middle_bundle_stops; /* number of stop bits in the middle of bundles */
struct bundle_state *next; /* next state with the same insn_num */
struct bundle_state *originator; /* originator (previous insn state) */
/* All bundle states are in the following chain. */
struct bundle_state *allocated_states_chain;
/* The DFA State after issuing the insn and the nops. */
state_t dfa_state;
};
/* The following is map insn number to the corresponding bundle state. */
static struct bundle_state **index_to_bundle_states;
/* The unique number of next bundle state. */
static int bundle_states_num;
/* All allocated bundle states are in the following chain. */
static struct bundle_state *allocated_bundle_states_chain;
/* All allocated but not used bundle states are in the following
chain. */
static struct bundle_state *free_bundle_state_chain;
/* The following function returns a free bundle state. */
static struct bundle_state *
get_free_bundle_state (void)
{
struct bundle_state *result;
if (free_bundle_state_chain != NULL)
{
result = free_bundle_state_chain;
free_bundle_state_chain = result->next;
}
else
{
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
result = XNEW (struct bundle_state);
result->dfa_state = xmalloc (dfa_state_size);
result->allocated_states_chain = allocated_bundle_states_chain;
allocated_bundle_states_chain = result;
}
result->unique_num = bundle_states_num++;
return result;
}
/* The following function frees given bundle state. */
static void
free_bundle_state (struct bundle_state *state)
{
state->next = free_bundle_state_chain;
free_bundle_state_chain = state;
}
/* Start work with abstract data `bundle states'. */
static void
initiate_bundle_states (void)
{
bundle_states_num = 0;
free_bundle_state_chain = NULL;
allocated_bundle_states_chain = NULL;
}
/* Finish work with abstract data `bundle states'. */
static void
finish_bundle_states (void)
{
struct bundle_state *curr_state, *next_state;
for (curr_state = allocated_bundle_states_chain;
curr_state != NULL;
curr_state = next_state)
{
next_state = curr_state->allocated_states_chain;
free (curr_state->dfa_state);
free (curr_state);
}
}
/* Hash table of the bundle states. The key is dfa_state and insn_num
of the bundle states. */
static htab_t bundle_state_table;
/* The function returns hash of BUNDLE_STATE. */
static unsigned
bundle_state_hash (const void *bundle_state)
{
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
const struct bundle_state *const state
= (const struct bundle_state *) bundle_state;
unsigned result, i;
for (result = i = 0; i < dfa_state_size; i++)
result += (((unsigned char *) state->dfa_state) [i]
<< ((i % CHAR_BIT) * 3 + CHAR_BIT));
return result + state->insn_num;
}
/* The function returns nonzero if the bundle state keys are equal. */
static int
bundle_state_eq_p (const void *bundle_state_1, const void *bundle_state_2)
{
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
const struct bundle_state *const state1
= (const struct bundle_state *) bundle_state_1;
const struct bundle_state *const state2
= (const struct bundle_state *) bundle_state_2;
return (state1->insn_num == state2->insn_num
&& memcmp (state1->dfa_state, state2->dfa_state,
dfa_state_size) == 0);
}
/* The function inserts the BUNDLE_STATE into the hash table. The
function returns nonzero if the bundle has been inserted into the
table. The table contains the best bundle state with given key. */
static int
insert_bundle_state (struct bundle_state *bundle_state)
{
void **entry_ptr;
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
entry_ptr = htab_find_slot (bundle_state_table, bundle_state, INSERT);
if (*entry_ptr == NULL)
{
bundle_state->next = index_to_bundle_states [bundle_state->insn_num];
index_to_bundle_states [bundle_state->insn_num] = bundle_state;
*entry_ptr = (void *) bundle_state;
return TRUE;
}
else if (bundle_state->cost < ((struct bundle_state *) *entry_ptr)->cost
|| (bundle_state->cost == ((struct bundle_state *) *entry_ptr)->cost
&& (((struct bundle_state *)*entry_ptr)->accumulated_insns_num
> bundle_state->accumulated_insns_num
|| (((struct bundle_state *)
*entry_ptr)->accumulated_insns_num
== bundle_state->accumulated_insns_num
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
&& (((struct bundle_state *)
*entry_ptr)->branch_deviation
> bundle_state->branch_deviation
|| (((struct bundle_state *)
*entry_ptr)->branch_deviation
== bundle_state->branch_deviation
&& ((struct bundle_state *)
*entry_ptr)->middle_bundle_stops
> bundle_state->middle_bundle_stops))))))
{
struct bundle_state temp;
temp = *(struct bundle_state *) *entry_ptr;
*(struct bundle_state *) *entry_ptr = *bundle_state;
((struct bundle_state *) *entry_ptr)->next = temp.next;
*bundle_state = temp;
}
return FALSE;
}
/* Start work with the hash table. */
static void
initiate_bundle_state_table (void)
{
bundle_state_table = htab_create (50, bundle_state_hash, bundle_state_eq_p,
(htab_del) 0);
}
/* Finish work with the hash table. */
static void
finish_bundle_state_table (void)
{
htab_delete (bundle_state_table);
}
/* The following variable is a insn `nop' used to check bundle states
with different number of inserted nops. */
static rtx ia64_nop;
/* The following function tries to issue NOPS_NUM nops for the current
state without advancing processor cycle. If it failed, the
function returns FALSE and frees the current state. */
static int
try_issue_nops (struct bundle_state *curr_state, int nops_num)
{
int i;
for (i = 0; i < nops_num; i++)
if (state_transition (curr_state->dfa_state, ia64_nop) >= 0)
{
free_bundle_state (curr_state);
return FALSE;
}
return TRUE;
}
/* The following function tries to issue INSN for the current
state without advancing processor cycle. If it failed, the
function returns FALSE and frees the current state. */
static int
try_issue_insn (struct bundle_state *curr_state, rtx insn)
{
if (insn && state_transition (curr_state->dfa_state, insn) >= 0)
{
free_bundle_state (curr_state);
return FALSE;
}
return TRUE;
}
/* The following function tries to issue BEFORE_NOPS_NUM nops and INSN
starting with ORIGINATOR without advancing processor cycle. If
TRY_BUNDLE_END_P is TRUE, the function also/only (if
ONLY_BUNDLE_END_P is TRUE) tries to issue nops to fill all bundle.
If it was successful, the function creates new bundle state and
insert into the hash table and into `index_to_bundle_states'. */
static void
issue_nops_and_insn (struct bundle_state *originator, int before_nops_num,
rtx insn, int try_bundle_end_p, int only_bundle_end_p)
{
struct bundle_state *curr_state;
curr_state = get_free_bundle_state ();
memcpy (curr_state->dfa_state, originator->dfa_state, dfa_state_size);
curr_state->insn = insn;
curr_state->insn_num = originator->insn_num + 1;
curr_state->cost = originator->cost;
curr_state->originator = originator;
curr_state->before_nops_num = before_nops_num;
curr_state->after_nops_num = 0;
curr_state->accumulated_insns_num
= originator->accumulated_insns_num + before_nops_num;
curr_state->branch_deviation = originator->branch_deviation;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
curr_state->middle_bundle_stops = originator->middle_bundle_stops;
gcc_assert (insn);
if (INSN_CODE (insn) == CODE_FOR_insn_group_barrier)
{
gcc_assert (GET_MODE (insn) != TImode);
if (!try_issue_nops (curr_state, before_nops_num))
return;
if (!try_issue_insn (curr_state, insn))
return;
memcpy (temp_dfa_state, curr_state->dfa_state, dfa_state_size);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (curr_state->accumulated_insns_num % 3 != 0)
curr_state->middle_bundle_stops++;
if (state_transition (temp_dfa_state, dfa_pre_cycle_insn) >= 0
&& curr_state->accumulated_insns_num % 3 != 0)
{
free_bundle_state (curr_state);
return;
}
}
else if (GET_MODE (insn) != TImode)
{
if (!try_issue_nops (curr_state, before_nops_num))
return;
if (!try_issue_insn (curr_state, insn))
return;
curr_state->accumulated_insns_num++;
gcc_assert (GET_CODE (PATTERN (insn)) != ASM_INPUT
&& asm_noperands (PATTERN (insn)) < 0);
if (ia64_safe_type (insn) == TYPE_L)
curr_state->accumulated_insns_num++;
}
else
{
/* If this is an insn that must be first in a group, then don't allow
nops to be emitted before it. Currently, alloc is the only such
supported instruction. */
/* ??? The bundling automatons should handle this for us, but they do
not yet have support for the first_insn attribute. */
if (before_nops_num > 0 && get_attr_first_insn (insn) == FIRST_INSN_YES)
{
free_bundle_state (curr_state);
return;
}
state_transition (curr_state->dfa_state, dfa_pre_cycle_insn);
state_transition (curr_state->dfa_state, NULL);
curr_state->cost++;
if (!try_issue_nops (curr_state, before_nops_num))
return;
if (!try_issue_insn (curr_state, insn))
return;
curr_state->accumulated_insns_num++;
if (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0)
{
/* Finish bundle containing asm insn. */
curr_state->after_nops_num
= 3 - curr_state->accumulated_insns_num % 3;
curr_state->accumulated_insns_num
+= 3 - curr_state->accumulated_insns_num % 3;
}
else if (ia64_safe_type (insn) == TYPE_L)
curr_state->accumulated_insns_num++;
}
if (ia64_safe_type (insn) == TYPE_B)
curr_state->branch_deviation
+= 2 - (curr_state->accumulated_insns_num - 1) % 3;
if (try_bundle_end_p && curr_state->accumulated_insns_num % 3 != 0)
{
if (!only_bundle_end_p && insert_bundle_state (curr_state))
{
state_t dfa_state;
struct bundle_state *curr_state1;
struct bundle_state *allocated_states_chain;
curr_state1 = get_free_bundle_state ();
dfa_state = curr_state1->dfa_state;
allocated_states_chain = curr_state1->allocated_states_chain;
*curr_state1 = *curr_state;
curr_state1->dfa_state = dfa_state;
curr_state1->allocated_states_chain = allocated_states_chain;
memcpy (curr_state1->dfa_state, curr_state->dfa_state,
dfa_state_size);
curr_state = curr_state1;
}
if (!try_issue_nops (curr_state,
3 - curr_state->accumulated_insns_num % 3))
return;
curr_state->after_nops_num
= 3 - curr_state->accumulated_insns_num % 3;
curr_state->accumulated_insns_num
+= 3 - curr_state->accumulated_insns_num % 3;
}
if (!insert_bundle_state (curr_state))
free_bundle_state (curr_state);
return;
}
/* The following function returns position in the two window bundle
for given STATE. */
static int
get_max_pos (state_t state)
{
if (cpu_unit_reservation_p (state, pos_6))
return 6;
else if (cpu_unit_reservation_p (state, pos_5))
return 5;
else if (cpu_unit_reservation_p (state, pos_4))
return 4;
else if (cpu_unit_reservation_p (state, pos_3))
return 3;
else if (cpu_unit_reservation_p (state, pos_2))
return 2;
else if (cpu_unit_reservation_p (state, pos_1))
return 1;
else
return 0;
}
/* The function returns code of a possible template for given position
and state. The function should be called only with 2 values of
position equal to 3 or 6. We avoid generating F NOPs by putting
templates containing F insns at the end of the template search
because undocumented anomaly in McKinley derived cores which can
cause stalls if an F-unit insn (including a NOP) is issued within a
six-cycle window after reading certain application registers (such
as ar.bsp). Furthermore, power-considerations also argue against
the use of F-unit instructions unless they're really needed. */
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
static int
get_template (state_t state, int pos)
{
switch (pos)
{
case 3:
if (cpu_unit_reservation_p (state, _0mmi_))
return 1;
else if (cpu_unit_reservation_p (state, _0mii_))
return 0;
else if (cpu_unit_reservation_p (state, _0mmb_))
return 7;
else if (cpu_unit_reservation_p (state, _0mib_))
return 6;
else if (cpu_unit_reservation_p (state, _0mbb_))
return 5;
else if (cpu_unit_reservation_p (state, _0bbb_))
return 4;
else if (cpu_unit_reservation_p (state, _0mmf_))
return 3;
else if (cpu_unit_reservation_p (state, _0mfi_))
return 2;
else if (cpu_unit_reservation_p (state, _0mfb_))
return 8;
else if (cpu_unit_reservation_p (state, _0mlx_))
return 9;
else
gcc_unreachable ();
case 6:
if (cpu_unit_reservation_p (state, _1mmi_))
return 1;
else if (cpu_unit_reservation_p (state, _1mii_))
return 0;
else if (cpu_unit_reservation_p (state, _1mmb_))
return 7;
else if (cpu_unit_reservation_p (state, _1mib_))
return 6;
else if (cpu_unit_reservation_p (state, _1mbb_))
return 5;
else if (cpu_unit_reservation_p (state, _1bbb_))
return 4;
else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_))
return 3;
else if (cpu_unit_reservation_p (state, _1mfi_))
return 2;
else if (cpu_unit_reservation_p (state, _1mfb_))
return 8;
else if (cpu_unit_reservation_p (state, _1mlx_))
return 9;
else
gcc_unreachable ();
default:
gcc_unreachable ();
}
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
/* True when INSN is important for bundling. */
static bool
important_for_bundling_p (rtx insn)
{
return (INSN_P (insn)
&& ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER);
}
/* The following function returns an insn important for insn bundling
followed by INSN and before TAIL. */
static rtx
get_next_important_insn (rtx insn, rtx tail)
{
for (; insn && insn != tail; insn = NEXT_INSN (insn))
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (important_for_bundling_p (insn))
return insn;
return NULL_RTX;
}
/* Add a bundle selector TEMPLATE0 before INSN. */
static void
ia64_add_bundle_selector_before (int template0, rtx insn)
{
rtx b = gen_bundle_selector (GEN_INT (template0));
ia64_emit_insn_before (b, insn);
#if NR_BUNDLES == 10
if ((template0 == 4 || template0 == 5)
&& (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)))
{
int i;
rtx note = NULL_RTX;
/* In .mbb and .bbb bundles, check if CALL_INSN isn't in the
first or second slot. If it is and has REG_EH_NOTE set, copy it
to following nops, as br.call sets rp to the address of following
bundle and therefore an EH region end must be on a bundle
boundary. */
insn = PREV_INSN (insn);
for (i = 0; i < 3; i++)
{
do
insn = next_active_insn (insn);
while (GET_CODE (insn) == INSN
&& get_attr_empty (insn) == EMPTY_YES);
if (GET_CODE (insn) == CALL_INSN)
note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
else if (note)
{
int code;
gcc_assert ((code = recog_memoized (insn)) == CODE_FOR_nop
|| code == CODE_FOR_nop_b);
if (find_reg_note (insn, REG_EH_REGION, NULL_RTX))
note = NULL_RTX;
else
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
add_reg_note (insn, REG_EH_REGION, XEXP (note, 0));
}
}
}
#endif
}
/* The following function does insn bundling. Bundling means
inserting templates and nop insns to fit insn groups into permitted
templates. Instruction scheduling uses NDFA (non-deterministic
finite automata) encoding informations about the templates and the
inserted nops. Nondeterminism of the automata permits follows
all possible insn sequences very fast.
Unfortunately it is not possible to get information about inserting
nop insns and used templates from the automata states. The
automata only says that we can issue an insn possibly inserting
some nops before it and using some template. Therefore insn
bundling in this function is implemented by using DFA
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
(deterministic finite automata). We follow all possible insn
sequences by inserting 0-2 nops (that is what the NDFA describe for
insn scheduling) before/after each insn being bundled. We know the
start of simulated processor cycle from insn scheduling (insn
starting a new cycle has TImode).
Simple implementation of insn bundling would create enormous
number of possible insn sequences satisfying information about new
cycle ticks taken from the insn scheduling. To make the algorithm
practical we use dynamic programming. Each decision (about
inserting nops and implicitly about previous decisions) is described
by structure bundle_state (see above). If we generate the same
bundle state (key is automaton state after issuing the insns and
nops for it), we reuse already generated one. As consequence we
reject some decisions which cannot improve the solution and
reduce memory for the algorithm.
When we reach the end of EBB (extended basic block), we choose the
best sequence and then, moving back in EBB, insert templates for
the best alternative. The templates are taken from querying
automaton state for each insn in chosen bundle states.
So the algorithm makes two (forward and backward) passes through
EBB. There is an additional forward pass through EBB for Itanium1
processor. This pass inserts more nops to make dependency between
a producer insn and MMMUL/MMSHF at least 4 cycles long. */
static void
bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
{
struct bundle_state *curr_state, *next_state, *best_state;
rtx insn, next_insn;
int insn_num;
int i, bundle_end_p, only_bundle_end_p, asm_p;
int pos = 0, max_pos, template0, template1;
rtx b;
rtx nop;
enum attr_type type;
insn_num = 0;
/* Count insns in the EBB. */
for (insn = NEXT_INSN (prev_head_insn);
insn && insn != tail;
insn = NEXT_INSN (insn))
if (INSN_P (insn))
insn_num++;
if (insn_num == 0)
return;
bundling_p = 1;
dfa_clean_insn_cache ();
initiate_bundle_state_table ();
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
index_to_bundle_states = XNEWVEC (struct bundle_state *, insn_num + 2);
/* First (forward) pass -- generation of bundle states. */
curr_state = get_free_bundle_state ();
curr_state->insn = NULL;
curr_state->before_nops_num = 0;
curr_state->after_nops_num = 0;
curr_state->insn_num = 0;
curr_state->cost = 0;
curr_state->accumulated_insns_num = 0;
curr_state->branch_deviation = 0;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
curr_state->middle_bundle_stops = 0;
curr_state->next = NULL;
curr_state->originator = NULL;
state_reset (curr_state->dfa_state);
index_to_bundle_states [0] = curr_state;
insn_num = 0;
/* Shift cycle mark if it is put on insn which could be ignored. */
for (insn = NEXT_INSN (prev_head_insn);
insn != tail;
insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& (ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IGNORE
|| GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER)
&& GET_MODE (insn) == TImode)
{
PUT_MODE (insn, VOIDmode);
for (next_insn = NEXT_INSN (insn);
next_insn != tail;
next_insn = NEXT_INSN (next_insn))
if (INSN_P (next_insn)
&& ia64_safe_itanium_class (next_insn) != ITANIUM_CLASS_IGNORE
&& GET_CODE (PATTERN (next_insn)) != USE
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
&& GET_CODE (PATTERN (next_insn)) != CLOBBER
&& INSN_CODE (next_insn) != CODE_FOR_insn_group_barrier)
{
PUT_MODE (next_insn, TImode);
break;
}
}
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
/* Forward pass: generation of bundle states. */
for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail);
insn != NULL_RTX;
insn = next_insn)
{
gcc_assert (INSN_P (insn)
&& ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER);
type = ia64_safe_type (insn);
next_insn = get_next_important_insn (NEXT_INSN (insn), tail);
insn_num++;
index_to_bundle_states [insn_num] = NULL;
for (curr_state = index_to_bundle_states [insn_num - 1];
curr_state != NULL;
curr_state = next_state)
{
pos = curr_state->accumulated_insns_num % 3;
next_state = curr_state->next;
/* We must fill up the current bundle in order to start a
subsequent asm insn in a new bundle. Asm insn is always
placed in a separate bundle. */
only_bundle_end_p
= (next_insn != NULL_RTX
&& INSN_CODE (insn) == CODE_FOR_insn_group_barrier
&& ia64_safe_type (next_insn) == TYPE_UNKNOWN);
/* We may fill up the current bundle if it is the cycle end
without a group barrier. */
bundle_end_p
= (only_bundle_end_p || next_insn == NULL_RTX
|| (GET_MODE (next_insn) == TImode
&& INSN_CODE (insn) != CODE_FOR_insn_group_barrier));
if (type == TYPE_F || type == TYPE_B || type == TYPE_L
|| type == TYPE_S
/* We need to insert 2 nops for cases like M_MII. To
guarantee issuing all insns on the same cycle for
Itanium 1, we need to issue 2 nops after the first M
insn (MnnMII where n is a nop insn). */
|| ((type == TYPE_M || type == TYPE_A)
&& ia64_tune == PROCESSOR_ITANIUM
&& !bundle_end_p && pos == 1))
issue_nops_and_insn (curr_state, 2, insn, bundle_end_p,
only_bundle_end_p);
issue_nops_and_insn (curr_state, 1, insn, bundle_end_p,
only_bundle_end_p);
issue_nops_and_insn (curr_state, 0, insn, bundle_end_p,
only_bundle_end_p);
}
gcc_assert (index_to_bundle_states [insn_num]);
for (curr_state = index_to_bundle_states [insn_num];
curr_state != NULL;
curr_state = curr_state->next)
if (verbose >= 2 && dump)
{
/* This structure is taken from generated code of the
pipeline hazard recognizer (see file insn-attrtab.c).
Please don't forget to change the structure if a new
automaton is added to .md file. */
struct DFA_chip
{
unsigned short one_automaton_state;
unsigned short oneb_automaton_state;
unsigned short two_automaton_state;
unsigned short twob_automaton_state;
};
fprintf
(dump,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
"// Bundle state %d (orig %d, cost %d, nops %d/%d, insns %d, branch %d, mid.stops %d state %d) for %d\n",
curr_state->unique_num,
(curr_state->originator == NULL
? -1 : curr_state->originator->unique_num),
curr_state->cost,
curr_state->before_nops_num, curr_state->after_nops_num,
curr_state->accumulated_insns_num, curr_state->branch_deviation,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
curr_state->middle_bundle_stops,
(ia64_tune == PROCESSOR_ITANIUM
? ((struct DFA_chip *) curr_state->dfa_state)->oneb_automaton_state
: ((struct DFA_chip *) curr_state->dfa_state)->twob_automaton_state),
INSN_UID (insn));
}
}
/* We should find a solution because the 2nd insn scheduling has
found one. */
gcc_assert (index_to_bundle_states [insn_num]);
/* Find a state corresponding to the best insn sequence. */
best_state = NULL;
for (curr_state = index_to_bundle_states [insn_num];
curr_state != NULL;
curr_state = curr_state->next)
/* We are just looking at the states with fully filled up last
bundle. The first we prefer insn sequences with minimal cost
then with minimal inserted nops and finally with branch insns
placed in the 3rd slots. */
if (curr_state->accumulated_insns_num % 3 == 0
&& (best_state == NULL || best_state->cost > curr_state->cost
|| (best_state->cost == curr_state->cost
&& (curr_state->accumulated_insns_num
< best_state->accumulated_insns_num
|| (curr_state->accumulated_insns_num
== best_state->accumulated_insns_num
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
&& (curr_state->branch_deviation
< best_state->branch_deviation
|| (curr_state->branch_deviation
== best_state->branch_deviation
&& curr_state->middle_bundle_stops
< best_state->middle_bundle_stops)))))))
best_state = curr_state;
/* Second (backward) pass: adding nops and templates. */
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (best_state);
insn_num = best_state->before_nops_num;
template0 = template1 = -1;
for (curr_state = best_state;
curr_state->originator != NULL;
curr_state = curr_state->originator)
{
insn = curr_state->insn;
asm_p = (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0);
insn_num++;
if (verbose >= 2 && dump)
{
struct DFA_chip
{
unsigned short one_automaton_state;
unsigned short oneb_automaton_state;
unsigned short two_automaton_state;
unsigned short twob_automaton_state;
};
fprintf
(dump,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
"// Best %d (orig %d, cost %d, nops %d/%d, insns %d, branch %d, mid.stops %d, state %d) for %d\n",
curr_state->unique_num,
(curr_state->originator == NULL
? -1 : curr_state->originator->unique_num),
curr_state->cost,
curr_state->before_nops_num, curr_state->after_nops_num,
curr_state->accumulated_insns_num, curr_state->branch_deviation,
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
curr_state->middle_bundle_stops,
(ia64_tune == PROCESSOR_ITANIUM
? ((struct DFA_chip *) curr_state->dfa_state)->oneb_automaton_state
: ((struct DFA_chip *) curr_state->dfa_state)->twob_automaton_state),
INSN_UID (insn));
}
/* Find the position in the current bundle window. The window can
contain at most two bundles. Two bundle window means that
the processor will make two bundle rotation. */
max_pos = get_max_pos (curr_state->dfa_state);
if (max_pos == 6
/* The following (negative template number) means that the
processor did one bundle rotation. */
|| (max_pos == 3 && template0 < 0))
{
/* We are at the end of the window -- find template(s) for
its bundle(s). */
pos = max_pos;
if (max_pos == 3)
template0 = get_template (curr_state->dfa_state, 3);
else
{
template1 = get_template (curr_state->dfa_state, 3);
template0 = get_template (curr_state->dfa_state, 6);
}
}
if (max_pos > 3 && template1 < 0)
/* It may happen when we have the stop inside a bundle. */
{
gcc_assert (pos <= 3);
template1 = get_template (curr_state->dfa_state, 3);
pos += 3;
}
if (!asm_p)
/* Emit nops after the current insn. */
for (i = 0; i < curr_state->after_nops_num; i++)
{
nop = gen_nop ();
emit_insn_after (nop, insn);
pos--;
gcc_assert (pos >= 0);
if (pos % 3 == 0)
{
/* We are at the start of a bundle: emit the template
(it should be defined). */
gcc_assert (template0 >= 0);
ia64_add_bundle_selector_before (template0, nop);
/* If we have two bundle window, we make one bundle
rotation. Otherwise template0 will be undefined
(negative value). */
template0 = template1;
template1 = -1;
}
}
/* Move the position backward in the window. Group barrier has
no slot. Asm insn takes all bundle. */
if (INSN_CODE (insn) != CODE_FOR_insn_group_barrier
&& GET_CODE (PATTERN (insn)) != ASM_INPUT
&& asm_noperands (PATTERN (insn)) < 0)
pos--;
/* Long insn takes 2 slots. */
if (ia64_safe_type (insn) == TYPE_L)
pos--;
gcc_assert (pos >= 0);
if (pos % 3 == 0
&& INSN_CODE (insn) != CODE_FOR_insn_group_barrier
&& GET_CODE (PATTERN (insn)) != ASM_INPUT
&& asm_noperands (PATTERN (insn)) < 0)
{
/* The current insn is at the bundle start: emit the
template. */
gcc_assert (template0 >= 0);
ia64_add_bundle_selector_before (template0, insn);
b = PREV_INSN (insn);
insn = b;
/* See comment above in analogous place for emitting nops
after the insn. */
template0 = template1;
template1 = -1;
}
/* Emit nops after the current insn. */
for (i = 0; i < curr_state->before_nops_num; i++)
{
nop = gen_nop ();
ia64_emit_insn_before (nop, insn);
nop = PREV_INSN (insn);
insn = nop;
pos--;
gcc_assert (pos >= 0);
if (pos % 3 == 0)
{
/* See comment above in analogous place for emitting nops
after the insn. */
gcc_assert (template0 >= 0);
ia64_add_bundle_selector_before (template0, insn);
b = PREV_INSN (insn);
insn = b;
template0 = template1;
template1 = -1;
}
}
}
if (ia64_tune == PROCESSOR_ITANIUM)
/* Insert additional cycles for MM-insns (MMMUL and MMSHF).
Itanium1 has a strange design, if the distance between an insn
and dependent MM-insn is less 4 then we have a 6 additional
cycles stall. So we make the distance equal to 4 cycles if it
is less. */
for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail);
insn != NULL_RTX;
insn = next_insn)
{
gcc_assert (INSN_P (insn)
&& ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER);
next_insn = get_next_important_insn (NEXT_INSN (insn), tail);
if (INSN_UID (insn) < clocks_length && add_cycles [INSN_UID (insn)])
/* We found a MM-insn which needs additional cycles. */
{
rtx last;
int i, j, n;
int pred_stop_p;
/* Now we are searching for a template of the bundle in
which the MM-insn is placed and the position of the
insn in the bundle (0, 1, 2). Also we are searching
for that there is a stop before the insn. */
last = prev_active_insn (insn);
pred_stop_p = recog_memoized (last) == CODE_FOR_insn_group_barrier;
if (pred_stop_p)
last = prev_active_insn (last);
n = 0;
for (;; last = prev_active_insn (last))
if (recog_memoized (last) == CODE_FOR_bundle_selector)
{
template0 = XINT (XVECEXP (PATTERN (last), 0, 0), 0);
if (template0 == 9)
/* The insn is in MLX bundle. Change the template
onto MFI because we will add nops before the
insn. It simplifies subsequent code a lot. */
PATTERN (last)
= gen_bundle_selector (const2_rtx); /* -> MFI */
break;
}
else if (recog_memoized (last) != CODE_FOR_insn_group_barrier
&& (ia64_safe_itanium_class (last)
!= ITANIUM_CLASS_IGNORE))
n++;
/* Some check of correctness: the stop is not at the
bundle start, there are no more 3 insns in the bundle,
and the MM-insn is not at the start of bundle with
template MLX. */
gcc_assert ((!pred_stop_p || n)
&& n <= 2
&& (template0 != 9 || !n));
/* Put nops after the insn in the bundle. */
for (j = 3 - n; j > 0; j --)
ia64_emit_insn_before (gen_nop (), insn);
/* It takes into account that we will add more N nops
before the insn lately -- please see code below. */
add_cycles [INSN_UID (insn)]--;
if (!pred_stop_p || add_cycles [INSN_UID (insn)])
ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
insn);
if (pred_stop_p)
add_cycles [INSN_UID (insn)]--;
for (i = add_cycles [INSN_UID (insn)]; i > 0; i--)
{
/* Insert "MII;" template. */
ia64_emit_insn_before (gen_bundle_selector (const0_rtx),
insn);
ia64_emit_insn_before (gen_nop (), insn);
ia64_emit_insn_before (gen_nop (), insn);
if (i > 1)
{
/* To decrease code size, we use "MI;I;"
template. */
ia64_emit_insn_before
(gen_insn_group_barrier (GEN_INT (3)), insn);
i--;
}
ia64_emit_insn_before (gen_nop (), insn);
ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
insn);
}
/* Put the MM-insn in the same slot of a bundle with the
same template as the original one. */
ia64_add_bundle_selector_before (template0, insn);
/* To put the insn in the same slot, add necessary number
of nops. */
for (j = n; j > 0; j --)
ia64_emit_insn_before (gen_nop (), insn);
/* Put the stop if the original bundle had it. */
if (pred_stop_p)
ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
insn);
}
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
#ifdef ENABLE_CHECKING
{
/* Assert right calculation of middle_bundle_stops. */
int num = best_state->middle_bundle_stops;
bool start_bundle = true, end_bundle = false;
for (insn = NEXT_INSN (prev_head_insn);
insn && insn != tail;
insn = NEXT_INSN (insn))
{
if (!INSN_P (insn))
continue;
if (recog_memoized (insn) == CODE_FOR_bundle_selector)
start_bundle = true;
else
{
rtx next_insn;
for (next_insn = NEXT_INSN (insn);
next_insn && next_insn != tail;
next_insn = NEXT_INSN (next_insn))
if (INSN_P (next_insn)
&& (ia64_safe_itanium_class (next_insn)
!= ITANIUM_CLASS_IGNORE
|| recog_memoized (next_insn)
== CODE_FOR_bundle_selector)
&& GET_CODE (PATTERN (next_insn)) != USE
&& GET_CODE (PATTERN (next_insn)) != CLOBBER)
break;
end_bundle = next_insn == NULL_RTX
|| next_insn == tail
|| (INSN_P (next_insn)
&& recog_memoized (next_insn)
== CODE_FOR_bundle_selector);
if (recog_memoized (insn) == CODE_FOR_insn_group_barrier
&& !start_bundle && !end_bundle
&& next_insn
&& GET_CODE (PATTERN (next_insn)) != ASM_INPUT
&& asm_noperands (PATTERN (next_insn)) < 0)
num--;
start_bundle = false;
}
}
gcc_assert (num == 0);
}
#endif
free (index_to_bundle_states);
finish_bundle_state_table ();
bundling_p = 0;
dfa_clean_insn_cache ();
}
2000-03-09 01:26:04 +01:00
/* The following function is called at the end of scheduling BB or
EBB. After reload, it inserts stop bits and does insn bundling. */
static void
ia64_sched_finish (FILE *dump, int sched_verbose)
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
{
if (sched_verbose)
fprintf (dump, "// Finishing schedule.\n");
if (!reload_completed)
return;
if (reload_completed)
{
final_emit_insn_group_barriers (dump);
bundling (dump, sched_verbose, current_sched_info->prev_head,
current_sched_info->next_tail);
if (sched_verbose && dump)
fprintf (dump, "// finishing %d-%d\n",
INSN_UID (NEXT_INSN (current_sched_info->prev_head)),
INSN_UID (PREV_INSN (current_sched_info->next_tail)));
return;
}
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
}
/* The following function inserts stop bits in scheduled BB or EBB. */
static void
final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
{
rtx insn;
int need_barrier_p = 0;
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
int seen_good_insn = 0;
rtx prev_insn = NULL_RTX;
init_insn_group_barriers ();
for (insn = NEXT_INSN (current_sched_info->prev_head);
insn != current_sched_info->next_tail;
insn = NEXT_INSN (insn))
{
if (GET_CODE (insn) == BARRIER)
{
rtx last = prev_active_insn (insn);
if (! last)
continue;
if (GET_CODE (last) == JUMP_INSN
&& GET_CODE (PATTERN (last)) == ADDR_DIFF_VEC)
last = prev_active_insn (last);
if (recog_memoized (last) != CODE_FOR_insn_group_barrier)
emit_insn_after (gen_insn_group_barrier (GEN_INT (3)), last);
init_insn_group_barriers ();
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
seen_good_insn = 0;
need_barrier_p = 0;
prev_insn = NULL_RTX;
}
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
else if (NONDEBUG_INSN_P (insn))
{
if (recog_memoized (insn) == CODE_FOR_insn_group_barrier)
{
init_insn_group_barriers ();
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
seen_good_insn = 0;
need_barrier_p = 0;
prev_insn = NULL_RTX;
2000-03-09 01:26:04 +01:00
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
else if (need_barrier_p || group_barrier_needed (insn)
|| (mflag_sched_stop_bits_after_every_cycle
&& GET_MODE (insn) == TImode
&& seen_good_insn))
{
if (TARGET_EARLY_STOP_BITS)
{
rtx last;
for (last = insn;
last != current_sched_info->prev_head;
last = PREV_INSN (last))
if (INSN_P (last) && GET_MODE (last) == TImode
&& stops_p [INSN_UID (last)])
break;
if (last == current_sched_info->prev_head)
last = insn;
last = prev_active_insn (last);
if (last
&& recog_memoized (last) != CODE_FOR_insn_group_barrier)
emit_insn_after (gen_insn_group_barrier (GEN_INT (3)),
last);
init_insn_group_barriers ();
for (last = NEXT_INSN (last);
last != insn;
last = NEXT_INSN (last))
if (INSN_P (last))
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
{
group_barrier_needed (last);
if (recog_memoized (last) >= 0
&& important_for_bundling_p (last))
seen_good_insn = 1;
}
}
else
{
emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
insn);
init_insn_group_barriers ();
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
seen_good_insn = 0;
}
group_barrier_needed (insn);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (recog_memoized (insn) >= 0
&& important_for_bundling_p (insn))
seen_good_insn = 1;
prev_insn = NULL_RTX;
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
else if (recog_memoized (insn) >= 0
&& important_for_bundling_p (insn))
{
prev_insn = insn;
seen_good_insn = 1;
}
need_barrier_p = (GET_CODE (insn) == CALL_INSN
|| GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0);
2000-03-09 01:26:04 +01:00
}
}
}
/* If the following function returns TRUE, we will use the DFA
insn scheduler. */
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
static int
ia64_first_cycle_multipass_dfa_lookahead (void)
{
return (reload_completed ? 6 : 4);
}
/* The following function initiates variable `dfa_pre_cycle_insn'. */
static void
ia64_init_dfa_pre_cycle_insn (void)
{
if (temp_dfa_state == NULL)
{
dfa_state_size = state_size ();
temp_dfa_state = xmalloc (dfa_state_size);
prev_cycle_state = xmalloc (dfa_state_size);
}
dfa_pre_cycle_insn = make_insn_raw (gen_pre_cycle ());
PREV_INSN (dfa_pre_cycle_insn) = NEXT_INSN (dfa_pre_cycle_insn) = NULL_RTX;
recog_memoized (dfa_pre_cycle_insn);
dfa_stop_insn = make_insn_raw (gen_insn_group_barrier (GEN_INT (3)));
PREV_INSN (dfa_stop_insn) = NEXT_INSN (dfa_stop_insn) = NULL_RTX;
recog_memoized (dfa_stop_insn);
}
/* The following function returns the pseudo insn DFA_PRE_CYCLE_INSN
used by the DFA insn scheduler. */
static rtx
ia64_dfa_pre_cycle_insn (void)
{
return dfa_pre_cycle_insn;
}
/* The following function returns TRUE if PRODUCER (of type ilog or
ld) produces address for CONSUMER (of type st or stf). */
int
ia64_st_address_bypass_p (rtx producer, rtx consumer)
{
rtx dest, reg, mem;
gcc_assert (producer && consumer);
dest = ia64_single_set (producer);
gcc_assert (dest);
reg = SET_DEST (dest);
gcc_assert (reg);
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
gcc_assert (GET_CODE (reg) == REG);
dest = ia64_single_set (consumer);
gcc_assert (dest);
mem = SET_DEST (dest);
gcc_assert (mem && GET_CODE (mem) == MEM);
return reg_mentioned_p (reg, mem);
}
/* The following function returns TRUE if PRODUCER (of type ilog or
ld) produces address for CONSUMER (of type ld or fld). */
int
ia64_ld_address_bypass_p (rtx producer, rtx consumer)
{
rtx dest, src, reg, mem;
gcc_assert (producer && consumer);
dest = ia64_single_set (producer);
gcc_assert (dest);
reg = SET_DEST (dest);
gcc_assert (reg);
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
gcc_assert (GET_CODE (reg) == REG);
src = ia64_single_set (consumer);
gcc_assert (src);
mem = SET_SRC (src);
gcc_assert (mem);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (GET_CODE (mem) == UNSPEC && XVECLEN (mem, 0) > 0)
mem = XVECEXP (mem, 0, 0);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
else if (GET_CODE (mem) == IF_THEN_ELSE)
/* ??? Is this bypass necessary for ld.c? */
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
{
gcc_assert (XINT (XEXP (XEXP (mem, 0), 0), 1) == UNSPEC_LDCCLR);
mem = XEXP (mem, 1);
}
while (GET_CODE (mem) == SUBREG || GET_CODE (mem) == ZERO_EXTEND)
mem = XEXP (mem, 0);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
if (GET_CODE (mem) == UNSPEC)
{
int c = XINT (mem, 1);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
gcc_assert (c == UNSPEC_LDA || c == UNSPEC_LDS || c == UNSPEC_LDS_A
|| c == UNSPEC_LDSA);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
mem = XVECEXP (mem, 0, 0);
}
/* Note that LO_SUM is used for GOT loads. */
gcc_assert (GET_CODE (mem) == LO_SUM || GET_CODE (mem) == MEM);
return reg_mentioned_p (reg, mem);
}
/* The following function returns TRUE if INSN produces address for a
load/store insn. We will place such insns into M slot because it
decreases its latency time. */
int
ia64_produce_address_p (rtx insn)
{
return insn->call;
}
/* Emit pseudo-ops for the assembler to describe predicate relations.
At present this assumes that we only consider predicate pairs to
be mutex, and that the assembler can deduce proper values from
straight-line code. */
static void
emit_predicate_relation_info (void)
{
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
basic_block bb;
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_EACH_BB_REVERSE (bb)
{
int r;
rtx head = BB_HEAD (bb);
/* We only need such notes at code labels. */
if (GET_CODE (head) != CODE_LABEL)
continue;
if (NOTE_INSN_BASIC_BLOCK_P (NEXT_INSN (head)))
head = NEXT_INSN (head);
/* Skip p0, which may be thought to be live due to (reg:DI p0)
grabbing the entire block of predicate registers. */
for (r = PR_REG (2); r < PR_REG (64); r += 2)
if (REGNO_REG_SET_P (df_get_live_in (bb), r))
{
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
rtx p = gen_rtx_REG (BImode, r);
rtx n = emit_insn_after (gen_pred_rel_mutex (p), head);
if (head == BB_END (bb))
BB_END (bb) = n;
head = n;
}
}
/* Look for conditional calls that do not return, and protect predicate
relations around them. Otherwise the assembler will assume the call
returns, and complain about uses of call-clobbered predicates after
the call. */
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
FOR_EACH_BB_REVERSE (bb)
{
rtx insn = BB_HEAD (bb);
while (1)
{
if (GET_CODE (insn) == CALL_INSN
&& GET_CODE (PATTERN (insn)) == COND_EXEC
&& find_reg_note (insn, REG_NORETURN, NULL_RTX))
{
rtx b = emit_insn_before (gen_safe_across_calls_all (), insn);
rtx a = emit_insn_after (gen_safe_across_calls_normal (), insn);
if (BB_HEAD (bb) == insn)
BB_HEAD (bb) = b;
if (BB_END (bb) == insn)
BB_END (bb) = a;
}
if (insn == BB_END (bb))
break;
insn = NEXT_INSN (insn);
}
}
}
2000-03-09 01:26:04 +01:00
/* Perform machine dependent operations on the rtl chain INSNS. */
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
static void
ia64_reorg (void)
2000-03-09 01:26:04 +01:00
{
/* We are freeing block_for_insn in the toplev to keep compatibility
with old MDEP_REORGS that are not CFG based. Recompute it now. */
compute_bb_for_insn ();
/* If optimizing, we'll have split before scheduling. */
if (optimize == 0)
split_all_insns ();
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (optimize && ia64_flag_schedule_insns2
&& dbg_cnt (ia64_sched2))
{
timevar_push (TV_SCHED2);
ia64_final_schedule = 1;
initiate_bundle_states ();
ia64_nop = make_insn_raw (gen_nop ());
PREV_INSN (ia64_nop) = NEXT_INSN (ia64_nop) = NULL_RTX;
recog_memoized (ia64_nop);
clocks_length = get_max_uid () + 1;
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
stops_p = XCNEWVEC (char, clocks_length);
if (ia64_tune == PROCESSOR_ITANIUM)
{
c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or -Wcast-qual warnings. * c-pragma.c (dpm_eq, handle_pragma_push_macro, handle_pragma_pop_macro): Likewise. * collect2.c (resolve_lib_name): Likewise. * config/arc/arc.c (arc_init): Likewise. * config/arm/arm.c (neon_builtin_compare, locate_neon_builtin_icode): Likewise. * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section): Likewise. * config/bfin/bfin.c (bfin_init_machine_status, bfin_optimize_loop): Likewise. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/cris/cris.c (cris_init_expanders): Likewise. * config/darwin-c.c (frameworks_in_use, add_framework): Likewise. * config/darwin.c (machopic_indirection_eq, machopic_indirection_name, machopic_output_indirection): Likewise. * config/frv/frv.c (frv_init_machine_status, frv_compare_insns, frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1, frv_optimize_membar): Likewise. * config/i386/cygwin.h (mingw_scan, GCC_DRIVER_HOST_INITIALIZATION): Likewise. * config/i386/cygwin1.c (mingw_scan): Likewise. * config/i386/i386.c (machopic_output_stub): Likewise. * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix, i386_pe_unique_section): Likewise. * config/ia64/ia64.c (ia64_init_machine_status, ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg): Likewise. * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise. * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise. * config/m68k/m68k.c (m68k_handle_option, m68k_sched_md_init_global): Likewise. * config/mcore/mcore.c (mcore_mark_dllexport, mcore_mark_dllimport, mcore_unique_section): Likewise. * config/mips/mips.c (mips_block_move_straight, mips16_rewrite_pool_refs, mips_sim_wait_regs_2, mips_sim_record_set): Likewise. * config/mmix/mmix.c (mmix_init_machine_status, mmix_encode_section_info): Likewise. * config/pa/pa.c (pa_init_machine_status, hppa_encode_label): Likewise. * config/rs6000/rs6000.c (rs6000_init_machine_status, print_operand_address, output_toc, redefine_groups, rs6000_elf_encode_section_info, machopic_output_stub): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_block_move_straight, score_block_move_loop_body): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * emit-rtl.c (find_auto_inc): Likewise. * gcc.c (translate_options, process_command): Likewise. * reorg.c (dbr_schedule): Likewise. * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise. * xcoffout.c (xcoffout_declare_function): Likewise. From-SVN: r137191
2008-06-27 18:53:54 +02:00
clocks = XCNEWVEC (int, clocks_length);
add_cycles = XCNEWVEC (int, clocks_length);
}
if (ia64_tune == PROCESSOR_ITANIUM2)
{
pos_1 = get_cpu_unit_code ("2_1");
pos_2 = get_cpu_unit_code ("2_2");
pos_3 = get_cpu_unit_code ("2_3");
pos_4 = get_cpu_unit_code ("2_4");
pos_5 = get_cpu_unit_code ("2_5");
pos_6 = get_cpu_unit_code ("2_6");
_0mii_ = get_cpu_unit_code ("2b_0mii.");
_0mmi_ = get_cpu_unit_code ("2b_0mmi.");
_0mfi_ = get_cpu_unit_code ("2b_0mfi.");
_0mmf_ = get_cpu_unit_code ("2b_0mmf.");
_0bbb_ = get_cpu_unit_code ("2b_0bbb.");
_0mbb_ = get_cpu_unit_code ("2b_0mbb.");
_0mib_ = get_cpu_unit_code ("2b_0mib.");
_0mmb_ = get_cpu_unit_code ("2b_0mmb.");
_0mfb_ = get_cpu_unit_code ("2b_0mfb.");
_0mlx_ = get_cpu_unit_code ("2b_0mlx.");
_1mii_ = get_cpu_unit_code ("2b_1mii.");
_1mmi_ = get_cpu_unit_code ("2b_1mmi.");
_1mfi_ = get_cpu_unit_code ("2b_1mfi.");
_1mmf_ = get_cpu_unit_code ("2b_1mmf.");
_1bbb_ = get_cpu_unit_code ("2b_1bbb.");
_1mbb_ = get_cpu_unit_code ("2b_1mbb.");
_1mib_ = get_cpu_unit_code ("2b_1mib.");
_1mmb_ = get_cpu_unit_code ("2b_1mmb.");
_1mfb_ = get_cpu_unit_code ("2b_1mfb.");
_1mlx_ = get_cpu_unit_code ("2b_1mlx.");
}
else
{
pos_1 = get_cpu_unit_code ("1_1");
pos_2 = get_cpu_unit_code ("1_2");
pos_3 = get_cpu_unit_code ("1_3");
pos_4 = get_cpu_unit_code ("1_4");
pos_5 = get_cpu_unit_code ("1_5");
pos_6 = get_cpu_unit_code ("1_6");
_0mii_ = get_cpu_unit_code ("1b_0mii.");
_0mmi_ = get_cpu_unit_code ("1b_0mmi.");
_0mfi_ = get_cpu_unit_code ("1b_0mfi.");
_0mmf_ = get_cpu_unit_code ("1b_0mmf.");
_0bbb_ = get_cpu_unit_code ("1b_0bbb.");
_0mbb_ = get_cpu_unit_code ("1b_0mbb.");
_0mib_ = get_cpu_unit_code ("1b_0mib.");
_0mmb_ = get_cpu_unit_code ("1b_0mmb.");
_0mfb_ = get_cpu_unit_code ("1b_0mfb.");
_0mlx_ = get_cpu_unit_code ("1b_0mlx.");
_1mii_ = get_cpu_unit_code ("1b_1mii.");
_1mmi_ = get_cpu_unit_code ("1b_1mmi.");
_1mfi_ = get_cpu_unit_code ("1b_1mfi.");
_1mmf_ = get_cpu_unit_code ("1b_1mmf.");
_1bbb_ = get_cpu_unit_code ("1b_1bbb.");
_1mbb_ = get_cpu_unit_code ("1b_1mbb.");
_1mib_ = get_cpu_unit_code ("1b_1mib.");
_1mmb_ = get_cpu_unit_code ("1b_1mmb.");
_1mfb_ = get_cpu_unit_code ("1b_1mfb.");
_1mlx_ = get_cpu_unit_code ("1b_1mlx.");
}
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
if (flag_selective_scheduling2
&& !maybe_skip_selective_scheduling ())
run_selective_scheduling ();
else
schedule_ebbs ();
/* Redo alignment computation, as it might gone wrong. */
compute_alignments ();
/* We cannot reuse this one because it has been corrupted by the
evil glat. */
finish_bundle_states ();
if (ia64_tune == PROCESSOR_ITANIUM)
{
free (add_cycles);
free (clocks);
}
free (stops_p);
ia64.c (stops_p): Added explicit initialization. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, ia64_sched_finish_global): New static functions to implement hooks from gcc_target.sched. (spec_check_no, max_uid, pending_data_specs): New static variables. (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, ia64_spec_check_src_p): New static functions. (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. (TARGET_SCHED_ADJUST_COST): Removed. (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros. (update_set_flags, group_barrier_needed, set_src_needs_barrier): Fixed to handle speculation checks. (rtx_needs_barrier): Fixed to handle speculative loads and their checks. (ia64_variable_issue): Added code to count speculative loads and their checks. (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle speculative loads. (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): New enumerations. (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): New constants. (ia64_ld_address_bypass_p): Fixed to handle speculative loads. (ia64_reorg): Reset stops_p to NULL after it is freed. * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, chk_a. (data_speculative, control_speculative, check_load): New attributes. (mov<mode>_advanced, mov<mode>_speculative, mov<mode>_speculative_advanced, zero_extend<mode>di2_advanced, zero_extend<mode>di2_speculative, zero_extend<mode>di2_speculative_advanced): New patterns for data and control speculative loads. (mov<mode>_clr, zero_extend<mode>di2_clr): New patterns for check loads. (advanced_load_check_clr_<mode>, speculation_check_<mode>): New pattern for data and control speculation checks. (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): Auxiliary definitions for the patterns. * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource constraints. (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition for speculation. (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): New resource constraints. (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition for speculation. (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): New flags to tune speculative scheduling. * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, msched-in-control-spec, msched-ldc, msched-control-ldc, msched-spec-verbose, msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path): Document new flags. From-SVN: r112129
2006-03-16 06:29:44 +01:00
stops_p = NULL;
emit_insn_group_barriers (dump_file);
ia64_final_schedule = 0;
timevar_pop (TV_SCHED2);
}
else
emit_all_insn_group_barriers (dump_file);
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
df_analyze ();
/* A call must not be the last instruction in a function, so that the
return address is still within the function, so that unwinding works
properly. Note that IA-64 differs from dwarf2 on this point. */
if (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS))
{
rtx insn;
int saw_stop = 0;
insn = get_last_insn ();
if (! INSN_P (insn))
insn = prev_active_insn (insn);
if (insn)
{
/* Skip over insns that expand to nothing. */
while (GET_CODE (insn) == INSN
&& get_attr_empty (insn) == EMPTY_YES)
{
if (GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
&& XINT (PATTERN (insn), 1) == UNSPECV_INSN_GROUP_BARRIER)
saw_stop = 1;
insn = prev_active_insn (insn);
}
if (GET_CODE (insn) == CALL_INSN)
{
if (! saw_stop)
emit_insn (gen_insn_group_barrier (GEN_INT (3)));
emit_insn (gen_break_f ());
emit_insn (gen_insn_group_barrier (GEN_INT (3)));
}
}
}
ia64-protos.h: Update. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (signed_inequality_operator): New. (ia64_expand_compare): New. (ia64_register_move_cost): Handle PR_REGS moves. (ia64_secondary_reload_class): Require a GR when moving to a PR. (struct reg_write_state): Add written_by_and/or. (struct reg_flags): Add is_and/or. (rws_update): Set them. (rws_access_regno): Test them to allow parallel comparisons. (rtx_needs_barrier): Recognize parallel comparisons. (emit_insn_group_barriers): Set prev_insn after a call stop bit. Call recog_memoized; ignore pred_rel_mutex. (emit_predicate_relation_info): Don't call find_basic_blocks here. (ia64_reorg): Do it here instead. * config/ia64/ia64.h: s/CCmode/BImode/g (MODES_TIEABLE_P): Don't tie BImode. (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. (CONST_COSTS): Pick sensible values for CONST_INT based on context. (RTX_COSTS): Make multiply 4 insns. (MEMORY_MOVE_COST): New. (PREDICATE_CODES): Update. * config/ia64/ia64.md: s/CCmode/BImode/g (movcci, movbi): New. (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. (mulsi, muldi): Use xmpy not xma. (cmpbi): New. (movcc, movcc_internal): Remove. (branch expanders): Use ia64_expand_compare. (setcc expanders): Likewise. (cmov insns): Use move_operand and ia64_move_ok. (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the scheduler from moving it past a use. * config/ia64/build.hacks: Remove. From-SVN: r36510
2000-09-18 21:03:37 +02:00
emit_predicate_relation_info ();
Josef Zlomek <zlomekj@suse.cz> Josef Zlomek <zlomekj@suse.cz> * Makefile.in (var-tracking.o): New. * common.opt (fvar-tracking): New. * flags.h (flag_var_tracking): New. * gengtype.c (adjust_field_rtx_def): NOTE_INSN_VAR_LOCATION was added. * opts.c (common_handle_option): Add OPT_fvar_tracking. * print-rtl.c (print_rtx): NOTE_INSN_VAR_LOCATION was added. * rtl.c (note_insn_name): Likewise. * rtl.def (VAR_LOCATION): New. * rtl.h (NOTE_VAR_LOCATION): New. (NOTE_VAR_LOCATION_DECL): New. (NOTE_VAR_LOCATION_LOC): New. (enum insn_note): NOTE_INSN_VAR_LOCATION was added. (variable_tracking_main): New exported function. * timevar.def (TV_VAR_TRACKING): New. * toplev.c (enum dump_file_index): Added DFI_vartrack. (dump_file): "vartrack" was added (-dV). (flag_var_tracking): New. (f_options): "var-tracking" was added. (rest_of_handle_variable_tracking): New function. (rest_of_compilation): Run variable tracking. (process_options): If user has not specified flag_var_tracking set it according to optimize, debug_info_level and debug_hooks. * tree.h (frame_base_decl): New. * var-tracking.c: New file. * config/ia64/ia64.c (ia64_flag_var_tracking): New variable. (ia64_override_options): Set flags to run variable tracking in machine dependent reorg instead of toplev.c. (ia64_reorg): Run variable tracking if wanted. * doc/invoke.texi: Mention variable tracking in -dV, add and -fvar-tracking. * doc/passes.texi: Added variable tracking pass. Daniel Berlin <dberlin@dberlin.org> * debug.h (struct gcc_debug_hooks): Added var_location debug hook. * dbxout.c (dbx_debug_hooks): Likewise. (xcoff_debug): Likewise. * debug.c (do_nothing_debug_hooks): Likewise. * dwarf2out.c (dwarf2_debug_hooks): Likewise. * dwarfout.c (dwarf_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * final.c (final_scan_insn): Call var_location debug hook for each NOTE_INSN_VAR_LOCATION. Co-Authored-By: Daniel Berlin <dberlin@dberlin.org> From-SVN: r77418
2004-02-06 21:03:45 +01:00
if (ia64_flag_var_tracking)
{
timevar_push (TV_VAR_TRACKING);
variable_tracking_main ();
timevar_pop (TV_VAR_TRACKING);
}
df_finish_pass (false);
2000-03-09 01:26:04 +01:00
}
/* Return true if REGNO is used by the epilogue. */
int
ia64_epilogue_uses (int regno)
2000-03-09 01:26:04 +01:00
{
switch (regno)
{
case R_GR (1):
/* With a call to a function in another module, we will write a new
value to "gp". After returning from such a call, we need to make
sure the function restores the original gp-value, even if the
function itself does not use the gp anymore. */
return !(TARGET_AUTO_PIC || TARGET_NO_PIC);
case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3):
case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7):
/* For functions defined with the syscall_linkage attribute, all
input registers are marked as live at all function exits. This
prevents the register allocator from using the input registers,
which in turn makes it possible to restart a system call after
an interrupt without having to save/restore the input registers.
This also prevents kernel data from leaking to application code. */
return lookup_attribute ("syscall_linkage",
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))) != NULL;
case R_BR (0):
/* Conditional return patterns can't represent the use of `b0' as
the return address, so we force the value live this way. */
return 1;
case AR_PFS_REGNUM:
/* Likewise for ar.pfs, which is used by br.ret. */
return 1;
Makefile.in (OBJS): Add doloop.o. * Makefile.in (OBJS): Add doloop.o. * doloop.c: New file. * final.c (insn_current_reference_address): Return 0 before final. * flags.h (flag_branch_on_count_reg): Fix typos in commentary. * jump.c (any_uncondjump_p): Likewise. * loop.c (indirect_jump_in_function): Make static. (strength_reduce): Call doloop_optimize. (insert_bct, instrument_loop_bct): Remove. * loop.h (doloop_optimize): Prototype. * recog.c (split_all_insns): Split all INSN_P. * toplev.c (flag_branch_on_count_reg): Default on. * config/c4x/c4x.c (c4x_optimization_options): Don't set flag_branch_on_count_reg. * config/i386/i386.c (override_options): Likewise. * config/rs6000/rs6000.c (optimization_options): Likewise. * config/i386/i386.md (decrement_and_branch_on_count): Remove. (doloop_end): New. (dbra_ge): Remove, as well as all it's splitters. * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. (doloop_end): New. * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. (ia64_register_move_cost): Declare. * config/ia64/ia64.c (ar_lc_reg_operand): New. (struct ia64_frame_info): Add ar_size. (ia64_compute_frame_size): Set it. (save_restore_insns): Save and restore ar.lc. (ia64_register_move_cost): New, moved from header file. Handle application registers. (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. (emit_insn_group_barriers): Special case doloop_end_internal. (ia64_epilogue_uses): Mark ar.lc live at end. * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. (FIRST_PSEUDO_REGISTER): Make room. (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. (REG_ALLOC_ORDER): Update. (HARD_REGNO_MODE_OK): Update. (REGISTER_NAMES): Update. (enum reg_class): Add AR_M_REGS and AR_I_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. (REGNO_REG_CLASS): Update. (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. (REGISTER_MOVE_COST): Move out of line. (PREDICATE_CODES): Update. * config/ia64/ia64.md (movdi patterns): Handle ar register classes. (addsi3_plus1_alt, adddi3_plus1_alt): New. (shladd_elim splitter): Allow constants in the predicate. (doloop_end, doloop_end_internal): New. From-SVN: r35358
2000-07-31 01:58:03 +02:00
default:
return 0;
}
2000-03-09 01:26:04 +01:00
}
/* Return true if REGNO is used by the frame unwinder. */
int
ia64_eh_uses (int regno)
{
unsigned int r;
if (! reload_completed)
return 0;
if (regno == 0)
return 0;
for (r = reg_save_b0; r <= reg_save_ar_lc; r++)
if (regno == current_frame_info.r[r]
|| regno == emitted_frame_related_regs[r])
return 1;
return 0;
}
2000-03-09 01:26:04 +01:00
/* Return true if this goes in small data/bss. */
2000-03-09 01:26:04 +01:00
/* ??? We could also support own long data here. Generating movl/add/ld8
instead of addl,ld8/ld8. This makes the code bigger, but should make the
code faster because there is one less load. This also includes incomplete
types which can't go in sdata/sbss. */
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
static bool
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
ia64_in_small_data_p (const_tree exp)
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
{
if (TARGET_NO_SDATA)
return false;
/* We want to merge strings, so we never consider them small data. */
if (TREE_CODE (exp) == STRING_CST)
return false;
/* Functions are never small data. */
if (TREE_CODE (exp) == FUNCTION_DECL)
return false;
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
if (strcmp (section, ".sdata") == 0
|| strncmp (section, ".sdata.", 7) == 0
|| strncmp (section, ".gnu.linkonce.s.", 16) == 0
|| strcmp (section, ".sbss") == 0
|| strncmp (section, ".sbss.", 6) == 0
|| strncmp (section, ".gnu.linkonce.sb.", 17) == 0)
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
return true;
}
else
{
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
/* If this is an incomplete type with size 0, then we can't put it
in sdata because it might be too big when completed. */
if (size > 0 && size <= ia64_section_threshold)
return true;
}
return false;
}
/* Output assembly directives for prologue regions. */
/* The current basic block number. */
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
static bool last_block;
/* True if we need a copy_state command at the start of the next block. */
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
static bool need_copy_state;
2006-02-04 23:08:04 +01:00
#ifndef MAX_ARTIFICIAL_LABEL_BYTES
# define MAX_ARTIFICIAL_LABEL_BYTES 30
#endif
/* Emit a debugging label after a call-frame-related insn. We'd
rather output the label right away, but we'd have to output it
after, not before, the instruction, and the instruction has not
been output yet. So we emit the label after the insn, delete it to
avoid introducing basic blocks, and mark it as preserved, such that
it is still output, given that it is referenced in debug info. */
static const char *
ia64_emit_deleted_label_after_insn (rtx insn)
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
rtx lb = gen_label_rtx ();
rtx label_insn = emit_label_after (lb, insn);
LABEL_PRESERVE_P (lb) = 1;
delete_insn (label_insn);
ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (label_insn));
return xstrdup (label);
}
/* Define the CFA after INSN with the steady-state definition. */
static void
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
ia64_dwarf2out_def_steady_cfa (rtx insn, bool frame)
2006-02-04 23:08:04 +01:00
{
rtx fp = frame_pointer_needed
? hard_frame_pointer_rtx
: stack_pointer_rtx;
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
const char *label = ia64_emit_deleted_label_after_insn (insn);
if (!frame)
return;
2006-02-04 23:08:04 +01:00
dwarf2out_def_cfa
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
(label, REGNO (fp),
2006-02-04 23:08:04 +01:00
ia64_initial_elimination_offset
(REGNO (arg_pointer_rtx), REGNO (fp))
+ ARG_POINTER_CFA_OFFSET (current_function_decl));
}
/* The generic dwarf2 frame debug info generator does not define a
separate region for the very end of the epilogue, so refrain from
doing so in the IA64-specific code as well. */
#define IA64_CHANGE_CFA_IN_EPILOGUE 0
/* The function emits unwind directives for the start of an epilogue. */
static void
2006-02-04 23:08:04 +01:00
process_epilogue (FILE *asm_out_file, rtx insn, bool unwind, bool frame)
{
/* If this isn't the last block of the function, then we need to label the
current state, and copy it back in at the start of the next block. */
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
if (!last_block)
{
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.label_state %d\n",
++cfun->machine->state_num);
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
need_copy_state = true;
}
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.restore sp\n");
if (IA64_CHANGE_CFA_IN_EPILOGUE && frame)
dwarf2out_def_cfa (ia64_emit_deleted_label_after_insn (insn),
STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET);
}
/* This function processes a SET pattern looking for specific patterns
which result in emitting an assembly directive required for unwinding. */
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
static int
2006-02-04 23:08:04 +01:00
process_set (FILE *asm_out_file, rtx pat, rtx insn, bool unwind, bool frame)
{
rtx src = SET_SRC (pat);
rtx dest = SET_DEST (pat);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
int src_regno, dest_regno;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Look for the ALLOC insn. */
if (GET_CODE (src) == UNSPEC_VOLATILE
&& XINT (src, 1) == UNSPECV_ALLOC
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
&& GET_CODE (dest) == REG)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
dest_regno = REGNO (dest);
/* If this is the final destination for ar.pfs, then this must
be the alloc in the prologue. */
if (dest_regno == current_frame_info.r[reg_save_ar_pfs])
2006-02-04 23:08:04 +01:00
{
if (unwind)
fprintf (asm_out_file, "\t.save ar.pfs, r%d\n",
ia64_dbx_register_number (dest_regno));
}
else
{
/* This must be an alloc before a sibcall. We must drop the
old frame info. The easiest way to drop the old frame
info is to ensure we had a ".restore sp" directive
followed by a new prologue. If the procedure doesn't
have a memory-stack frame, we'll issue a dummy ".restore
sp" now. */
if (current_frame_info.total_size == 0 && !frame_pointer_needed)
/* if haven't done process_epilogue() yet, do it now */
2006-02-04 23:08:04 +01:00
process_epilogue (asm_out_file, insn, unwind, frame);
if (unwind)
fprintf (asm_out_file, "\t.prologue\n");
}
return 1;
}
/* Look for SP = .... */
if (GET_CODE (dest) == REG && REGNO (dest) == STACK_POINTER_REGNUM)
{
if (GET_CODE (src) == PLUS)
{
rtx op0 = XEXP (src, 0);
rtx op1 = XEXP (src, 1);
gcc_assert (op0 == dest && GET_CODE (op1) == CONST_INT);
if (INTVAL (op1) < 0)
2006-02-04 23:08:04 +01:00
{
gcc_assert (!frame_pointer_needed);
if (unwind)
fprintf (asm_out_file, "\t.fframe "HOST_WIDE_INT_PRINT_DEC"\n",
-INTVAL (op1));
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
ia64_dwarf2out_def_steady_cfa (insn, frame);
2006-02-04 23:08:04 +01:00
}
else
2006-02-04 23:08:04 +01:00
process_epilogue (asm_out_file, insn, unwind, frame);
}
else
{
gcc_assert (GET_CODE (src) == REG
&& REGNO (src) == HARD_FRAME_POINTER_REGNUM);
2006-02-04 23:08:04 +01:00
process_epilogue (asm_out_file, insn, unwind, frame);
}
return 1;
}
/* Register move we need to look at. */
if (GET_CODE (dest) == REG && GET_CODE (src) == REG)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
src_regno = REGNO (src);
dest_regno = REGNO (dest);
switch (src_regno)
{
case BR_REG (0):
/* Saving return address pointer. */
gcc_assert (dest_regno == current_frame_info.r[reg_save_b0]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save rp, r%d\n",
ia64_dbx_register_number (dest_regno));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case PR_REG (0):
gcc_assert (dest_regno == current_frame_info.r[reg_save_pr]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save pr, r%d\n",
ia64_dbx_register_number (dest_regno));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case AR_UNAT_REGNUM:
gcc_assert (dest_regno == current_frame_info.r[reg_save_ar_unat]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save ar.unat, r%d\n",
ia64_dbx_register_number (dest_regno));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case AR_LC_REGNUM:
gcc_assert (dest_regno == current_frame_info.r[reg_save_ar_lc]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save ar.lc, r%d\n",
ia64_dbx_register_number (dest_regno));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case STACK_POINTER_REGNUM:
gcc_assert (dest_regno == HARD_FRAME_POINTER_REGNUM
&& frame_pointer_needed);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.vframe r%d\n",
ia64_dbx_register_number (dest_regno));
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
ia64_dwarf2out_def_steady_cfa (insn, frame);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
default:
/* Everything else should indicate being stored to memory. */
gcc_unreachable ();
}
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
/* Memory store we need to look at. */
if (GET_CODE (dest) == MEM && GET_CODE (src) == REG)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
long off;
rtx base;
const char *saveop;
if (GET_CODE (XEXP (dest, 0)) == REG)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
base = XEXP (dest, 0);
off = 0;
}
else
{
gcc_assert (GET_CODE (XEXP (dest, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
base = XEXP (XEXP (dest, 0), 0);
off = INTVAL (XEXP (XEXP (dest, 0), 1));
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
if (base == hard_frame_pointer_rtx)
{
saveop = ".savepsp";
off = - off;
}
else
{
gcc_assert (base == stack_pointer_rtx);
saveop = ".savesp";
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
src_regno = REGNO (src);
switch (src_regno)
{
case BR_REG (0):
gcc_assert (!current_frame_info.r[reg_save_b0]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t%s rp, %ld\n", saveop, off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case PR_REG (0):
gcc_assert (!current_frame_info.r[reg_save_pr]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t%s pr, %ld\n", saveop, off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case AR_LC_REGNUM:
gcc_assert (!current_frame_info.r[reg_save_ar_lc]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t%s ar.lc, %ld\n", saveop, off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case AR_PFS_REGNUM:
gcc_assert (!current_frame_info.r[reg_save_ar_pfs]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t%s ar.pfs, %ld\n", saveop, off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case AR_UNAT_REGNUM:
gcc_assert (!current_frame_info.r[reg_save_ar_unat]);
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t%s ar.unat, %ld\n", saveop, off);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case GR_REG (4):
case GR_REG (5):
case GR_REG (6):
case GR_REG (7):
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save.g 0x%x\n",
1 << (src_regno - GR_REG (4)));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case BR_REG (1):
case BR_REG (2):
case BR_REG (3):
case BR_REG (4):
case BR_REG (5):
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save.b 0x%x\n",
1 << (src_regno - BR_REG (1)));
return 1;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
case FR_REG (2):
case FR_REG (3):
case FR_REG (4):
case FR_REG (5):
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save.f 0x%x\n",
1 << (src_regno - FR_REG (2)));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
case FR_REG (16): case FR_REG (17): case FR_REG (18): case FR_REG (19):
case FR_REG (20): case FR_REG (21): case FR_REG (22): case FR_REG (23):
case FR_REG (24): case FR_REG (25): case FR_REG (26): case FR_REG (27):
case FR_REG (28): case FR_REG (29): case FR_REG (30): case FR_REG (31):
2006-02-04 23:08:04 +01:00
if (unwind)
fprintf (asm_out_file, "\t.save.gf 0x0, 0x%x\n",
1 << (src_regno - FR_REG (12)));
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 1;
default:
return 0;
}
}
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
return 0;
}
/* This function looks at a single insn and emits any directives
required to unwind this insn. */
void
process_for_unwind_directive (FILE *asm_out_file, rtx insn)
{
2006-02-04 23:08:04 +01:00
bool unwind = (flag_unwind_tables
|| (flag_exceptions && !USING_SJLJ_EXCEPTIONS));
bool frame = dwarf2out_do_frame ();
if (unwind || frame)
{
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
rtx pat;
if (NOTE_INSN_BASIC_BLOCK_P (insn))
{
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
last_block = NOTE_BASIC_BLOCK (insn)->next_bb == EXIT_BLOCK_PTR;
/* Restore unwind state from immediately before the epilogue. */
if (need_copy_state)
{
2006-02-04 23:08:04 +01:00
if (unwind)
{
fprintf (asm_out_file, "\t.body\n");
fprintf (asm_out_file, "\t.copy_state %d\n",
cfun->machine->state_num);
}
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
if (IA64_CHANGE_CFA_IN_EPILOGUE)
ia64_dwarf2out_def_steady_cfa (insn, frame);
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain. * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Use FOR_EACH_BB macros to iterate over basic block chain. * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): Likewise. * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, find_unreachable_blocks, create_edge_list, verify_edge_list, remove_fake_edges, add_noreturn_fake_exit_edges, flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): Likewise. * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): Likewise. * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): Likewise. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): Likewise. * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, commit_edge_insertions, commit_edge_insertions_watch_calls, print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. * combine.c (combine_instructions, reg_dead_at_p): Likewise. * conflict.c (conflict_graph_compute): Likewise. * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, df_modified_p, df_refs_unlink, df_dump): Likewise. * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. * final.c (compute_alignments): Likewise. * flow.c (update_life_info, update_life_info_in_dirty_blocks, delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, count_or_remove_death_notes): Likewise. * gcse.c (oprs_unchanged_p, record_last_reg_set_info, compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, classic_gcse, compute_transp, cprop, compute_pre_data, compute_transpout, invalidate_nonnull_info, delete_null_pointer_checks_1, delete_null_pointer_checks, compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, compute_store_table, build_store_vectors, store_motion): Likewise. * global.c (global_conflicts, mark_elimination): Likewise. * graph.c (print_rtl_graph_with_bb): Likewise. * haifa-sched.c (sched_init): Likewise. * ifcvt.c (if_convert): Likewise. * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete, optimize_mode_switching): Likewise. * local-alloc.c (local_alloc, update_equiv_regs): Likewise. * predict.c (estimate_probability, note_prediction_to_br_prob, propagate_freq, counts_to_freqs, expensive_function_p, estimate_bb_frequencies): Likewise. * profile.c (instrument_edges, get_exec_counts, compute_branch_probabilities, compute_checksum, branch_prob, find_spanning_tree): Likewise. * recog.c (split_all_insns, peephole2_optimize): Likewise. * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): Likewise. * regclass.c (scan_one_insn, regclass): Likewise. * regmove.c (mark_flags_life_zones, regmove_optimize, record_stack_memrefs): Likewise. * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. * resource.c (find_basic_block): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, build_control_flow, find_single_block_region, find_rgns, schedule_insns) * sibcall.c (optimize_sibling_and_tail_recursive_call) * ssa-ccp.c (optimize_unexecutable_edges, ssa_ccp_df_delete_unreachable_insns): Likewise. * ssa-dce.c (ssa_eliminate_dead_code): Likewise. * ssa.c (find_evaluations, compute_dominance_frontiers_1, rename_block, convert_to_ssa, compute_conservative_reg_partition, compute_coalesced_reg_partition, rename_equivalent_regs, convert_from_ssa): Likewise. * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, process_for_unwind_directive): Likewise. * df.c (FOR_ALL_BBS): Removed. * gcse.c (struct null_pointer_info): Type of current_block field changed. (struct reg_avail_info): Type of last_bb field changed. * config/ia64/ia64.c (block_num): Removed. (need_copy_state): Type changed. (last_block): New. From-SVN: r53804
2002-05-23 21:23:51 +02:00
need_copy_state = false;
}
}
if (GET_CODE (insn) == NOTE || ! RTX_FRAME_RELATED_P (insn))
return;
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
pat = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
if (pat)
pat = XEXP (pat, 0);
else
pat = PATTERN (insn);
switch (GET_CODE (pat))
{
case SET:
2006-02-04 23:08:04 +01:00
process_set (asm_out_file, pat, insn, unwind, frame);
break;
case PARALLEL:
{
int par_index;
int limit = XVECLEN (pat, 0);
for (par_index = 0; par_index < limit; par_index++)
{
rtx x = XVECEXP (pat, 0, par_index);
if (GET_CODE (x) == SET)
2006-02-04 23:08:04 +01:00
process_set (asm_out_file, x, insn, unwind, frame);
}
break;
}
default:
gcc_unreachable ();
}
}
}
2000-03-09 01:26:04 +01:00
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
enum ia64_builtins
{
IA64_BUILTIN_BSP,
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
IA64_BUILTIN_COPYSIGNQ,
IA64_BUILTIN_FABSQ,
IA64_BUILTIN_FLUSHRS,
IA64_BUILTIN_INFQ,
IA64_BUILTIN_HUGE_VALQ
};
2000-03-09 01:26:04 +01:00
void
ia64_init_builtins (void)
2000-03-09 01:26:04 +01:00
{
tree fpreg_type;
tree float80_type;
/* The __fpreg type. */
fpreg_type = make_node (REAL_TYPE);
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
TYPE_PRECISION (fpreg_type) = 82;
layout_type (fpreg_type);
(*lang_hooks.types.register_builtin_type) (fpreg_type, "__fpreg");
/* The __float80 type. */
float80_type = make_node (REAL_TYPE);
TYPE_PRECISION (float80_type) = 80;
layout_type (float80_type);
(*lang_hooks.types.register_builtin_type) (float80_type, "__float80");
/* The __float128 type. */
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
if (!TARGET_HPUX)
{
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
tree ftype, decl;
tree float128_type = make_node (REAL_TYPE);
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
TYPE_PRECISION (float128_type) = 128;
layout_type (float128_type);
(*lang_hooks.types.register_builtin_type) (float128_type, "__float128");
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
/* TFmode support builtins. */
ftype = build_function_type (float128_type, void_list_node);
add_builtin_function ("__builtin_infq", ftype,
IA64_BUILTIN_INFQ, BUILT_IN_MD,
NULL, NULL_TREE);
add_builtin_function ("__builtin_huge_valq", ftype,
IA64_BUILTIN_HUGE_VALQ, BUILT_IN_MD,
NULL, NULL_TREE);
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
ftype = build_function_type_list (float128_type,
float128_type,
NULL_TREE);
decl = add_builtin_function ("__builtin_fabsq", ftype,
IA64_BUILTIN_FABSQ, BUILT_IN_MD,
"__fabstf2", NULL_TREE);
TREE_READONLY (decl) = 1;
ftype = build_function_type_list (float128_type,
float128_type,
float128_type,
NULL_TREE);
decl = add_builtin_function ("__builtin_copysignq", ftype,
IA64_BUILTIN_COPYSIGNQ, BUILT_IN_MD,
"__copysigntf3", NULL_TREE);
TREE_READONLY (decl) = 1;
}
else
genmodes.c (struct mode_data): Add contained and next_cont fields. * genmodes.c (struct mode_data): Add contained and next_cont fields. (complete_mode): Maintain linked list of modes that have a given component. (emit_mode_unit_size): Delete. (emit_mode_nunits): New. (emit_insn_modes_c): Update to match. (emit_mode_adjustments): Propagate size and alignment adjustments from component modes to their containers. * machmode.h (mode_unit_size): Delete. (mode_nunits): New. (GET_MODE_NUNITS): Just return the value in the table. (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and GET_MODE_SIZE. * expmed.c (store_bit_field, extract_bit_field): Can use a plain move instruction if bitsize >= GET_MODE_BITSIZE of destination/source mode, respectively. * varasm.c (assemble_real): Write out the full size of the constant, not just its bitsize. (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and alignment of XF and TF modes in compliance with ia64 ABIs. Can now hardwire the format of both modes. * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. (general_tfmode_operand, destination_tfmode_operand) (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to general_xfmode_operand, destination_xfmode_operand, xfreg_or_fp01_operand, spill_xfmode_operand respectively. (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define __float128. * config/ia64/ia64.h: Default TARGET_HPUX to 0. Change TFmode to XFmode wherever appropriate. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). (PREDICATE_CODES): Update to match function renames. * config/ia64/ia64.md: Change TF to XF throughout; rename all patterns to match. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match function renames. * config/ia64/ia64-protos.c: Update all prototypes to match renamed functions. * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. Remove all references to INTEL_EXTENDED_IEEE_FORMAT. * config/ia64/lib1funcs.asm: Add __divxf3 as new name for __divtf3; keep old name for backward compatibility. (L__compat): New section providing forwarding stubs for __fixtfti, __fixunstfti, __floattitf. * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. From-SVN: r72916
2003-10-25 04:03:40 +02:00
/* Under HPUX, this is a synonym for "long double". */
(*lang_hooks.types.register_builtin_type) (long_double_type_node,
"__float128");
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* Fwrite on VMS is non-standard. */
if (TARGET_ABI_OPEN_VMS)
{
implicit_built_in_decls[(int) BUILT_IN_FWRITE] = NULL_TREE;
implicit_built_in_decls[(int) BUILT_IN_FWRITE_UNLOCKED] = NULL_TREE;
}
#define def_builtin(name, type, code) \
decl.c: Include langhooks.h. * gcc/java/decl.c: Include langhooks.h. (builtin_function): Remove. (java_init_decl_processing): Replace calls to builtin_function with add_builtin_function. * gcc/java/Make-lang.in (jc1$(exeext)): Depend on and link with attribs.o. (java/decl.o): Depend on langhooks.h. * gcc/java/java-tree.h (builtin_function): Remove. * gcc/tree.c (local_define_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/objc/objc-act.c (synth_module_prologue): Replace calls to builtin_function with add_builtin_function. (build_next_objc_exception_stuff): Replace calls to builtin_function with add_builtin_function. (build_objc_exception_stuff): Replace calls to builtin_function with add_builtin_function. * gcc/objcp/objcp-decl.h (objcp_builtin_function): Remove. * gcc/cp/decl.c (builtin_function_1): Move common code to add_builtin_function. (builtin_function): Rename to cxx_builtin_function. Change the signature. * gcc/cp/call.c: Include langhooks.h. (build_java_interface_fn_ref): Replace calls to builtin_function with add_builtin_function. * gcc/cp/Make-lang.in (cp/call.o): Depend on langhooks.h. * gcc/cp/cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as cxx_builtin_function. * gcc/cp/cp-tree.h (builtin_function): Rename to cxx_builtin_function. Change the signature. * gcc/c-objc-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as c_builtin_function. * gcc/c-tree.h (builtin_function): Rename to c_builtin_function. Change the signature. * gcc/ada/utils.c (builtin_function): Rename to gnat_builtin_function. Move common code to add_builtin_function. * gcc/ada/misc.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as gnat_builtin_function. * gcc/ada/gigi.h (builtin_function): Rename to gnat_builtin_function. Change the signature. * gcc/c-decl.c (builtin_function): Rename to c_builtin_function. Move common code to add_builtin_function. * gcc/fortran/Make-lang.in (f951$(exeext)): Depend on and link with attribs.o. * gcc/fortran/trans.h (builtin_function): Rename to gfc_builtin_function. Change the signature. * gcc/fortran/f95-lang.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as gfc_builtin_function. (builtin_function): Rename to gfc_builtin_function. Move common code to builtin_function. (gfc_define_builtin): Replace calls to builtin_function with gfc_define_builtin. * gcc/langhooks.c (add_builtin_function): New function. (lhd_builtin_function): New function. * gcc/langhooks.h (struct lang_hooks): Change the signature of builtin_function. (add_builtin_function): New function. * gcc/treelang/treetree.c (builtin_function): Remove. * gcc/tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/c-common.c (decl_builtin_1): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/alpha/alpha.c (alpha_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/frv/frv.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/s390/s390.c (s390_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/sparc/sparc.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/i386/i386.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/sh/sh.c (sh_media_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/c4x/c4x.c (c4x_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/stormy16/stormy16.c (xstormy16_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/iq2000/iq2000.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/ia64/ia64.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/rs6000/rs6000.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. (altivec_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/arm/arm.c (def_mbuiltin): Replace calls to lang_hooks.builtin_function with add_builtin_function. (arm_init_tls_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/mips/mips.c (mips_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/bfin/bfin.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/langhooks-def.h (lhd_builtin_function): New function. (LANG_HOOKS_BUILTIN_FUNCTION): Define as lhd_builtin_function. From-SVN: r117981
2006-10-23 21:47:58 +02:00
add_builtin_function ((name), (type), (code), BUILT_IN_MD, \
NULL, NULL_TREE)
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
def_builtin ("__builtin_ia64_bsp",
build_function_type (ptr_type_node, void_list_node),
IA64_BUILTIN_BSP);
except.c (func_eh_entry): Add emitted field. 2000-05-25 Andrew MacLeod <amacleod@cygnus.com> Andrew Haley <aph@cygnus.com> * except.c (func_eh_entry): Add emitted field. (new_eh_region_entry): Set emitted field to 0; (output_exception_table_entry): Only emit previously un-emitted data, and send it to the eh_data section. (output_exception_table): Break out common parts. Output exception table for entire compilation unit to eh_data section. (output_exception_table_data): Common parts of output_exception_table. Send output to eh_data section. (output_function_exception_table): Output exception table data for a single function to eh_data section. (free_exception_table): New external to free the table. * except.h (free_exception_table): Add prototype. (output_function_exception_table): Add prototype. * final.c (final_end_function): Output function exception table for IA64_UNWIND_INFO. (final_scan_insn): Emit any unwind directives for an insn. * frame-dwarf2.c: New file containing all DWARF 2 specific code from frame.c. * frame.c: Remove all DWARF 2 specific code. * config/ia64/frame-ia64.c: New file. (gthread_stuff): Make all gthread available with IA64_UNWIND_INFO. (dwarf_fde): Define an IA64 struct for dwarf_fde. (__register_frame_info, __register_frame): Move to common area of file. (__register_frame_info_table, __register_frame_table): Move to common i area. (__deregister_frame_info, __deregister_frame): Move to common area. (__frame_init, find_fde): New versions for IA64_UNWIND_INFO. (read_uleb128): New version for ia64. (get_unwind_record): Read the next IA-64 unwind record. (read_R_record): Read a region header record. (process_a_b_reg_code): X record helper. (read_X_record): Read an X format record. (read_B_record): Read a B format record. (P3_record_types): List of record types matching the P3 format. (P7_record_types): List of record types matching the P7 format. (P8_record_types): List of record types matching the P8 format. (read_P_record): Read a P format record. (init_ia64_reg_loc): Set default fields for a register. (init_ia64_unwind_frame): Set defaults for all register records. (execute_one_ia64_descriptor): Execute one descriptor record. (rse_address_add): Calculate the position of a local reg in memory. (normalize_reg_loc): Turn a location descriptor into a memory address. (maybe_normalize_reg_loc): Only normalize a descriptor if it falls within a specified PC offset range. (get_real_reg_value): Given a register location, retrieve its value. (set_real_reg_value): Change the value of a register location. (copy_reg_value): Copy reg values, if needed. (copy_saved_reg_state): Copy all registers that need to be copied. (process_state_between): Normalize all frame register records that fall within the specified PC range. (frame_translate): Take a processed frame description, and turn everything into addresses. (build_ia64_frame_state ): Find and create frame state record for a PC. (get_personality): Get the personality routine for a given frame. (get_except_table): Get the exception table for a given frame. (record_name): Unwind record names for debugging. (print_record): Print and unwind record. (print_all_records): Print an entire unwind image. (__ia64_backtrace): Print a backtrace. (ia64_backtrace_helper): New function. (__register_frame_info_aux): New function. * config/ia64/crtend.asm (__do_frame_setup_aux): New function. * frame.h (enum unw_record_type): New unwind record types. (struct unw_p_record, unw_b_record, unw_x_record) : New unwind records. (struct unw_r_record, unwind_record): New unwind record structs. (struct unwind_info_ptr): Unwind information layout. (IA64_UNW_LOC_TYPE_*): Macros for different types for location descriptors. (struct ia64_reg_loc): Register location description. (struct ia64_frame_state): Location of all registers in a frame. (struct object): Add pc_base and fde_end for IA64_UNWIND_INFO. * libgcc2.c (__ia64_personality_v1): Personality routine. (__calc_caller_bsp): Calculate the bsp register for the caller's frame. (ia64_throw_helper): Figure out who to return to and set up the registers. (__throw): Throw routine. * output.h (assemble_eh_align, assemble_eh_label): New functions to generate EH info where we want it. (assemble_eh_integer): New function. * toplev.c (compile_file): Output module level exception table for non-ia64 targets. (main): Set exceptions_via_longjump and flag_new_exceptions based on IA64_UNWIND_INFO too. * varasm.c (assemble_eh_label): Generate a label via ASM_OUTPUT_EH_LABEL if it has been specified. (assemble_eh_align): Generate an alignment directive via ASM_OUTPUT_EH_ALIGN if it has been specified. (assemble_eh_label): Generate an integer value via ASM_OUTPUT_EH_type if they have been specified. * config/ia64/ia64.c (rtx_needs_barrier): Add flushrs. (ia64_init_builtins): Add __builtin_ia64_bsp and __builtin_ia64_flushrs. (ia64_expand_builtin): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.md (flushrs): New insn to flush the register stack. Add to unspec list. * config/ia64/crtbegin.asm (frame_object): Change size. (__do_frame_setup_aux): New function. * config/ia64/crtend.asm: call __do_frame_setup_aux. * config/ia64/t-ia64 (LIB2ADDEH): Add. * Makefile.in (LIB2ADDEH): Add. (LIB2ADD): Use LIB2ADDEH. Co-Authored-By: Andrew Haley <aph@cygnus.com> From-SVN: r34169
2000-05-25 17:21:51 +02:00
def_builtin ("__builtin_ia64_flushrs",
build_function_type (void_type_node, void_list_node),
except.c (func_eh_entry): Add emitted field. 2000-05-25 Andrew MacLeod <amacleod@cygnus.com> Andrew Haley <aph@cygnus.com> * except.c (func_eh_entry): Add emitted field. (new_eh_region_entry): Set emitted field to 0; (output_exception_table_entry): Only emit previously un-emitted data, and send it to the eh_data section. (output_exception_table): Break out common parts. Output exception table for entire compilation unit to eh_data section. (output_exception_table_data): Common parts of output_exception_table. Send output to eh_data section. (output_function_exception_table): Output exception table data for a single function to eh_data section. (free_exception_table): New external to free the table. * except.h (free_exception_table): Add prototype. (output_function_exception_table): Add prototype. * final.c (final_end_function): Output function exception table for IA64_UNWIND_INFO. (final_scan_insn): Emit any unwind directives for an insn. * frame-dwarf2.c: New file containing all DWARF 2 specific code from frame.c. * frame.c: Remove all DWARF 2 specific code. * config/ia64/frame-ia64.c: New file. (gthread_stuff): Make all gthread available with IA64_UNWIND_INFO. (dwarf_fde): Define an IA64 struct for dwarf_fde. (__register_frame_info, __register_frame): Move to common area of file. (__register_frame_info_table, __register_frame_table): Move to common i area. (__deregister_frame_info, __deregister_frame): Move to common area. (__frame_init, find_fde): New versions for IA64_UNWIND_INFO. (read_uleb128): New version for ia64. (get_unwind_record): Read the next IA-64 unwind record. (read_R_record): Read a region header record. (process_a_b_reg_code): X record helper. (read_X_record): Read an X format record. (read_B_record): Read a B format record. (P3_record_types): List of record types matching the P3 format. (P7_record_types): List of record types matching the P7 format. (P8_record_types): List of record types matching the P8 format. (read_P_record): Read a P format record. (init_ia64_reg_loc): Set default fields for a register. (init_ia64_unwind_frame): Set defaults for all register records. (execute_one_ia64_descriptor): Execute one descriptor record. (rse_address_add): Calculate the position of a local reg in memory. (normalize_reg_loc): Turn a location descriptor into a memory address. (maybe_normalize_reg_loc): Only normalize a descriptor if it falls within a specified PC offset range. (get_real_reg_value): Given a register location, retrieve its value. (set_real_reg_value): Change the value of a register location. (copy_reg_value): Copy reg values, if needed. (copy_saved_reg_state): Copy all registers that need to be copied. (process_state_between): Normalize all frame register records that fall within the specified PC range. (frame_translate): Take a processed frame description, and turn everything into addresses. (build_ia64_frame_state ): Find and create frame state record for a PC. (get_personality): Get the personality routine for a given frame. (get_except_table): Get the exception table for a given frame. (record_name): Unwind record names for debugging. (print_record): Print and unwind record. (print_all_records): Print an entire unwind image. (__ia64_backtrace): Print a backtrace. (ia64_backtrace_helper): New function. (__register_frame_info_aux): New function. * config/ia64/crtend.asm (__do_frame_setup_aux): New function. * frame.h (enum unw_record_type): New unwind record types. (struct unw_p_record, unw_b_record, unw_x_record) : New unwind records. (struct unw_r_record, unwind_record): New unwind record structs. (struct unwind_info_ptr): Unwind information layout. (IA64_UNW_LOC_TYPE_*): Macros for different types for location descriptors. (struct ia64_reg_loc): Register location description. (struct ia64_frame_state): Location of all registers in a frame. (struct object): Add pc_base and fde_end for IA64_UNWIND_INFO. * libgcc2.c (__ia64_personality_v1): Personality routine. (__calc_caller_bsp): Calculate the bsp register for the caller's frame. (ia64_throw_helper): Figure out who to return to and set up the registers. (__throw): Throw routine. * output.h (assemble_eh_align, assemble_eh_label): New functions to generate EH info where we want it. (assemble_eh_integer): New function. * toplev.c (compile_file): Output module level exception table for non-ia64 targets. (main): Set exceptions_via_longjump and flag_new_exceptions based on IA64_UNWIND_INFO too. * varasm.c (assemble_eh_label): Generate a label via ASM_OUTPUT_EH_LABEL if it has been specified. (assemble_eh_align): Generate an alignment directive via ASM_OUTPUT_EH_ALIGN if it has been specified. (assemble_eh_label): Generate an integer value via ASM_OUTPUT_EH_type if they have been specified. * config/ia64/ia64.c (rtx_needs_barrier): Add flushrs. (ia64_init_builtins): Add __builtin_ia64_bsp and __builtin_ia64_flushrs. (ia64_expand_builtin): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.md (flushrs): New insn to flush the register stack. Add to unspec list. * config/ia64/crtbegin.asm (frame_object): Change size. (__do_frame_setup_aux): New function. * config/ia64/crtend.asm: call __do_frame_setup_aux. * config/ia64/t-ia64 (LIB2ADDEH): Add. * Makefile.in (LIB2ADDEH): Add. (LIB2ADD): Use LIB2ADDEH. Co-Authored-By: Andrew Haley <aph@cygnus.com> From-SVN: r34169
2000-05-25 17:21:51 +02:00
IA64_BUILTIN_FLUSHRS);
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
#undef def_builtin
if (TARGET_HPUX)
{
if (built_in_decls [BUILT_IN_FINITE])
set_user_assembler_name (built_in_decls [BUILT_IN_FINITE],
"_Isfinite");
if (built_in_decls [BUILT_IN_FINITEF])
set_user_assembler_name (built_in_decls [BUILT_IN_FINITEF],
"_Isfinitef");
if (built_in_decls [BUILT_IN_FINITEL])
set_user_assembler_name (built_in_decls [BUILT_IN_FINITEL],
"_Isfinitef128");
}
2000-03-09 01:26:04 +01:00
}
rtx
ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED,
int ignore ATTRIBUTE_UNUSED)
2000-03-09 01:26:04 +01:00
{
tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
ia64-protos.h: Remove duplicates. * config/ia64/ia64-protos.h: Remove duplicates. Update for massive code rearrangements. * config/ia64/ia64.c (ia64_arpfs_regno): Remove. (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. (ia64_local_regs, ia64_need_regstk): Remove. (ar_ccv_reg_operand): New. (ia64_gp_save_reg): New. (struct ia64_frame_info): Combine most of the size elements; add new gr save elements. (find_gr_spill): New. (next_scratch_gr_reg): New. (mark_reg_gr_used_mask): New. (ia64_compute_frame_size): Rewrite. Allocate special AR regs to GR backing store regs when possible. (ia64_initial_elimination_offset): New. (ia64_rap_fp_offset): Remove. (save_restore_insns): Remove. (setup_spill_pointers): New. (finish_spill_pointers): New. (spill_restore_mem): New. (do_spill, do_restore): New. (ia64_expand_prologue): Rewrite to use them. (ia64_expand_epilogue): Likewise. (ia64_direct_return): Update for current_frame_info changes. (ia64_function_prologue): Simplify .prologue emission. Emit .spill when needed. (ia64_setup_incoming_varargs): Don't ever emit rtl. (ia64_dbx_register_number): New. (ia64_initialize_trampoline): New. (ia64_secondary_reload_class): Request GR_REGS for integer arithmetic destined for FR_REGS. (ia64_init_machine_status): Don't reset return_address_pointer_rtx. (ia64_mark_machine_status): Mark ia64_gp_save. (rws_access_regno): Rename from rws_access_reg; don't treat predicates specially. (rws_access_reg): New. Update all callers. (rtx_needs_barrier): Remove dead unspecs. (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. (ia64_encode_section_info): Silence signed/unsigned warnings. (spill_offset, sp_offset, spill_offset_emitted): Remove. (tmp_reg, tmp_saved): Remove. (process_set): Rewrite to expect complicated bits via REG_FRAME_RELATED_EXPR. (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit in the use of ar.ccv; never set RTX_UNCHANGING_P. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_builtin): Likewise. * config/ia64/ia64.h (AR_UNAT_REGNUM): New. (FIRST_PSEUDO_REGISTER): Update. (AR_M_REGNO_P): Update. (FIXED_REGS): Don't mark three local registers as used. (EXTRA_CC_MODES): New. (SELECT_CC_MODE): New. (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. (FRAME_GROWS_DOWNWARD): Unset. (STARTING_FRAME_OFFSET): Zero. (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. (HARD_FRAME_POINTER_REGNUM): New. (CAN_DEBUG_WITHOUT_FP): Define. (TRAMPOLINE_TEMPLATE): Remove. (TRAMPOLINE_SIZE): Lower to 32. (TRAMPOLINE_ALIGNMENT): Lower to 64. (INITIALIZE_TRAMPOLINE): Defer to out of line function. (PREDICATE_CODES): Update. (struct machine_function): Add ia64_gp_save. * config/ia64/ia64.md: Purge unused unspecs. (movsi patterns): Allow moves to/from AR_M_REGS. (movdi patterns): Allow moves to/from p0. (call patterns): Move most setjmp hackery to ia64_gp_save_reg. (gr_spill, gr_restore): Indicate ar.unat read/written. (nonlocal_goto): Don't pass old frame_pointer. (nonlocal_goto_receiver): Remove. (exception_receiver): New. (builtin_setjmp_setup): New. (builtin_setjmp_receiver): New. * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. (__ia64_nonlocal_goto): Bundle. Don't kill r7. (__ia64_restore_stack_nonlocal): Likewise. (__ia64_trampoline): New. * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line function. * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. From-SVN: r35568
2000-08-08 12:01:20 +02:00
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
2000-03-09 01:26:04 +01:00
switch (fcode)
{
except.c (func_eh_entry): Add emitted field. 2000-05-25 Andrew MacLeod <amacleod@cygnus.com> Andrew Haley <aph@cygnus.com> * except.c (func_eh_entry): Add emitted field. (new_eh_region_entry): Set emitted field to 0; (output_exception_table_entry): Only emit previously un-emitted data, and send it to the eh_data section. (output_exception_table): Break out common parts. Output exception table for entire compilation unit to eh_data section. (output_exception_table_data): Common parts of output_exception_table. Send output to eh_data section. (output_function_exception_table): Output exception table data for a single function to eh_data section. (free_exception_table): New external to free the table. * except.h (free_exception_table): Add prototype. (output_function_exception_table): Add prototype. * final.c (final_end_function): Output function exception table for IA64_UNWIND_INFO. (final_scan_insn): Emit any unwind directives for an insn. * frame-dwarf2.c: New file containing all DWARF 2 specific code from frame.c. * frame.c: Remove all DWARF 2 specific code. * config/ia64/frame-ia64.c: New file. (gthread_stuff): Make all gthread available with IA64_UNWIND_INFO. (dwarf_fde): Define an IA64 struct for dwarf_fde. (__register_frame_info, __register_frame): Move to common area of file. (__register_frame_info_table, __register_frame_table): Move to common i area. (__deregister_frame_info, __deregister_frame): Move to common area. (__frame_init, find_fde): New versions for IA64_UNWIND_INFO. (read_uleb128): New version for ia64. (get_unwind_record): Read the next IA-64 unwind record. (read_R_record): Read a region header record. (process_a_b_reg_code): X record helper. (read_X_record): Read an X format record. (read_B_record): Read a B format record. (P3_record_types): List of record types matching the P3 format. (P7_record_types): List of record types matching the P7 format. (P8_record_types): List of record types matching the P8 format. (read_P_record): Read a P format record. (init_ia64_reg_loc): Set default fields for a register. (init_ia64_unwind_frame): Set defaults for all register records. (execute_one_ia64_descriptor): Execute one descriptor record. (rse_address_add): Calculate the position of a local reg in memory. (normalize_reg_loc): Turn a location descriptor into a memory address. (maybe_normalize_reg_loc): Only normalize a descriptor if it falls within a specified PC offset range. (get_real_reg_value): Given a register location, retrieve its value. (set_real_reg_value): Change the value of a register location. (copy_reg_value): Copy reg values, if needed. (copy_saved_reg_state): Copy all registers that need to be copied. (process_state_between): Normalize all frame register records that fall within the specified PC range. (frame_translate): Take a processed frame description, and turn everything into addresses. (build_ia64_frame_state ): Find and create frame state record for a PC. (get_personality): Get the personality routine for a given frame. (get_except_table): Get the exception table for a given frame. (record_name): Unwind record names for debugging. (print_record): Print and unwind record. (print_all_records): Print an entire unwind image. (__ia64_backtrace): Print a backtrace. (ia64_backtrace_helper): New function. (__register_frame_info_aux): New function. * config/ia64/crtend.asm (__do_frame_setup_aux): New function. * frame.h (enum unw_record_type): New unwind record types. (struct unw_p_record, unw_b_record, unw_x_record) : New unwind records. (struct unw_r_record, unwind_record): New unwind record structs. (struct unwind_info_ptr): Unwind information layout. (IA64_UNW_LOC_TYPE_*): Macros for different types for location descriptors. (struct ia64_reg_loc): Register location description. (struct ia64_frame_state): Location of all registers in a frame. (struct object): Add pc_base and fde_end for IA64_UNWIND_INFO. * libgcc2.c (__ia64_personality_v1): Personality routine. (__calc_caller_bsp): Calculate the bsp register for the caller's frame. (ia64_throw_helper): Figure out who to return to and set up the registers. (__throw): Throw routine. * output.h (assemble_eh_align, assemble_eh_label): New functions to generate EH info where we want it. (assemble_eh_integer): New function. * toplev.c (compile_file): Output module level exception table for non-ia64 targets. (main): Set exceptions_via_longjump and flag_new_exceptions based on IA64_UNWIND_INFO too. * varasm.c (assemble_eh_label): Generate a label via ASM_OUTPUT_EH_LABEL if it has been specified. (assemble_eh_align): Generate an alignment directive via ASM_OUTPUT_EH_ALIGN if it has been specified. (assemble_eh_label): Generate an integer value via ASM_OUTPUT_EH_type if they have been specified. * config/ia64/ia64.c (rtx_needs_barrier): Add flushrs. (ia64_init_builtins): Add __builtin_ia64_bsp and __builtin_ia64_flushrs. (ia64_expand_builtin): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.md (flushrs): New insn to flush the register stack. Add to unspec list. * config/ia64/crtbegin.asm (frame_object): Change size. (__do_frame_setup_aux): New function. * config/ia64/crtend.asm: call __do_frame_setup_aux. * config/ia64/t-ia64 (LIB2ADDEH): Add. * Makefile.in (LIB2ADDEH): Add. (LIB2ADD): Use LIB2ADDEH. Co-Authored-By: Andrew Haley <aph@cygnus.com> From-SVN: r34169
2000-05-25 17:21:51 +02:00
case IA64_BUILTIN_BSP:
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
if (! target || ! register_operand (target, DImode))
target = gen_reg_rtx (DImode);
emit_insn (gen_bsp_value (target));
#ifdef POINTERS_EXTEND_UNSIGNED
target = convert_memory_address (ptr_mode, target);
#endif
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
return target;
except.c (func_eh_entry): Add emitted field. 2000-05-25 Andrew MacLeod <amacleod@cygnus.com> Andrew Haley <aph@cygnus.com> * except.c (func_eh_entry): Add emitted field. (new_eh_region_entry): Set emitted field to 0; (output_exception_table_entry): Only emit previously un-emitted data, and send it to the eh_data section. (output_exception_table): Break out common parts. Output exception table for entire compilation unit to eh_data section. (output_exception_table_data): Common parts of output_exception_table. Send output to eh_data section. (output_function_exception_table): Output exception table data for a single function to eh_data section. (free_exception_table): New external to free the table. * except.h (free_exception_table): Add prototype. (output_function_exception_table): Add prototype. * final.c (final_end_function): Output function exception table for IA64_UNWIND_INFO. (final_scan_insn): Emit any unwind directives for an insn. * frame-dwarf2.c: New file containing all DWARF 2 specific code from frame.c. * frame.c: Remove all DWARF 2 specific code. * config/ia64/frame-ia64.c: New file. (gthread_stuff): Make all gthread available with IA64_UNWIND_INFO. (dwarf_fde): Define an IA64 struct for dwarf_fde. (__register_frame_info, __register_frame): Move to common area of file. (__register_frame_info_table, __register_frame_table): Move to common i area. (__deregister_frame_info, __deregister_frame): Move to common area. (__frame_init, find_fde): New versions for IA64_UNWIND_INFO. (read_uleb128): New version for ia64. (get_unwind_record): Read the next IA-64 unwind record. (read_R_record): Read a region header record. (process_a_b_reg_code): X record helper. (read_X_record): Read an X format record. (read_B_record): Read a B format record. (P3_record_types): List of record types matching the P3 format. (P7_record_types): List of record types matching the P7 format. (P8_record_types): List of record types matching the P8 format. (read_P_record): Read a P format record. (init_ia64_reg_loc): Set default fields for a register. (init_ia64_unwind_frame): Set defaults for all register records. (execute_one_ia64_descriptor): Execute one descriptor record. (rse_address_add): Calculate the position of a local reg in memory. (normalize_reg_loc): Turn a location descriptor into a memory address. (maybe_normalize_reg_loc): Only normalize a descriptor if it falls within a specified PC offset range. (get_real_reg_value): Given a register location, retrieve its value. (set_real_reg_value): Change the value of a register location. (copy_reg_value): Copy reg values, if needed. (copy_saved_reg_state): Copy all registers that need to be copied. (process_state_between): Normalize all frame register records that fall within the specified PC range. (frame_translate): Take a processed frame description, and turn everything into addresses. (build_ia64_frame_state ): Find and create frame state record for a PC. (get_personality): Get the personality routine for a given frame. (get_except_table): Get the exception table for a given frame. (record_name): Unwind record names for debugging. (print_record): Print and unwind record. (print_all_records): Print an entire unwind image. (__ia64_backtrace): Print a backtrace. (ia64_backtrace_helper): New function. (__register_frame_info_aux): New function. * config/ia64/crtend.asm (__do_frame_setup_aux): New function. * frame.h (enum unw_record_type): New unwind record types. (struct unw_p_record, unw_b_record, unw_x_record) : New unwind records. (struct unw_r_record, unwind_record): New unwind record structs. (struct unwind_info_ptr): Unwind information layout. (IA64_UNW_LOC_TYPE_*): Macros for different types for location descriptors. (struct ia64_reg_loc): Register location description. (struct ia64_frame_state): Location of all registers in a frame. (struct object): Add pc_base and fde_end for IA64_UNWIND_INFO. * libgcc2.c (__ia64_personality_v1): Personality routine. (__calc_caller_bsp): Calculate the bsp register for the caller's frame. (ia64_throw_helper): Figure out who to return to and set up the registers. (__throw): Throw routine. * output.h (assemble_eh_align, assemble_eh_label): New functions to generate EH info where we want it. (assemble_eh_integer): New function. * toplev.c (compile_file): Output module level exception table for non-ia64 targets. (main): Set exceptions_via_longjump and flag_new_exceptions based on IA64_UNWIND_INFO too. * varasm.c (assemble_eh_label): Generate a label via ASM_OUTPUT_EH_LABEL if it has been specified. (assemble_eh_align): Generate an alignment directive via ASM_OUTPUT_EH_ALIGN if it has been specified. (assemble_eh_label): Generate an integer value via ASM_OUTPUT_EH_type if they have been specified. * config/ia64/ia64.c (rtx_needs_barrier): Add flushrs. (ia64_init_builtins): Add __builtin_ia64_bsp and __builtin_ia64_flushrs. (ia64_expand_builtin): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.md (flushrs): New insn to flush the register stack. Add to unspec list. * config/ia64/crtbegin.asm (frame_object): Change size. (__do_frame_setup_aux): New function. * config/ia64/crtend.asm: call __do_frame_setup_aux. * config/ia64/t-ia64 (LIB2ADDEH): Add. * Makefile.in (LIB2ADDEH): Add. (LIB2ADD): Use LIB2ADDEH. Co-Authored-By: Andrew Haley <aph@cygnus.com> From-SVN: r34169
2000-05-25 17:21:51 +02:00
case IA64_BUILTIN_FLUSHRS:
emit_insn (gen_flushrs ());
return const0_rtx;
except.c (func_eh_entry): Add emitted field. 2000-05-25 Andrew MacLeod <amacleod@cygnus.com> Andrew Haley <aph@cygnus.com> * except.c (func_eh_entry): Add emitted field. (new_eh_region_entry): Set emitted field to 0; (output_exception_table_entry): Only emit previously un-emitted data, and send it to the eh_data section. (output_exception_table): Break out common parts. Output exception table for entire compilation unit to eh_data section. (output_exception_table_data): Common parts of output_exception_table. Send output to eh_data section. (output_function_exception_table): Output exception table data for a single function to eh_data section. (free_exception_table): New external to free the table. * except.h (free_exception_table): Add prototype. (output_function_exception_table): Add prototype. * final.c (final_end_function): Output function exception table for IA64_UNWIND_INFO. (final_scan_insn): Emit any unwind directives for an insn. * frame-dwarf2.c: New file containing all DWARF 2 specific code from frame.c. * frame.c: Remove all DWARF 2 specific code. * config/ia64/frame-ia64.c: New file. (gthread_stuff): Make all gthread available with IA64_UNWIND_INFO. (dwarf_fde): Define an IA64 struct for dwarf_fde. (__register_frame_info, __register_frame): Move to common area of file. (__register_frame_info_table, __register_frame_table): Move to common i area. (__deregister_frame_info, __deregister_frame): Move to common area. (__frame_init, find_fde): New versions for IA64_UNWIND_INFO. (read_uleb128): New version for ia64. (get_unwind_record): Read the next IA-64 unwind record. (read_R_record): Read a region header record. (process_a_b_reg_code): X record helper. (read_X_record): Read an X format record. (read_B_record): Read a B format record. (P3_record_types): List of record types matching the P3 format. (P7_record_types): List of record types matching the P7 format. (P8_record_types): List of record types matching the P8 format. (read_P_record): Read a P format record. (init_ia64_reg_loc): Set default fields for a register. (init_ia64_unwind_frame): Set defaults for all register records. (execute_one_ia64_descriptor): Execute one descriptor record. (rse_address_add): Calculate the position of a local reg in memory. (normalize_reg_loc): Turn a location descriptor into a memory address. (maybe_normalize_reg_loc): Only normalize a descriptor if it falls within a specified PC offset range. (get_real_reg_value): Given a register location, retrieve its value. (set_real_reg_value): Change the value of a register location. (copy_reg_value): Copy reg values, if needed. (copy_saved_reg_state): Copy all registers that need to be copied. (process_state_between): Normalize all frame register records that fall within the specified PC range. (frame_translate): Take a processed frame description, and turn everything into addresses. (build_ia64_frame_state ): Find and create frame state record for a PC. (get_personality): Get the personality routine for a given frame. (get_except_table): Get the exception table for a given frame. (record_name): Unwind record names for debugging. (print_record): Print and unwind record. (print_all_records): Print an entire unwind image. (__ia64_backtrace): Print a backtrace. (ia64_backtrace_helper): New function. (__register_frame_info_aux): New function. * config/ia64/crtend.asm (__do_frame_setup_aux): New function. * frame.h (enum unw_record_type): New unwind record types. (struct unw_p_record, unw_b_record, unw_x_record) : New unwind records. (struct unw_r_record, unwind_record): New unwind record structs. (struct unwind_info_ptr): Unwind information layout. (IA64_UNW_LOC_TYPE_*): Macros for different types for location descriptors. (struct ia64_reg_loc): Register location description. (struct ia64_frame_state): Location of all registers in a frame. (struct object): Add pc_base and fde_end for IA64_UNWIND_INFO. * libgcc2.c (__ia64_personality_v1): Personality routine. (__calc_caller_bsp): Calculate the bsp register for the caller's frame. (ia64_throw_helper): Figure out who to return to and set up the registers. (__throw): Throw routine. * output.h (assemble_eh_align, assemble_eh_label): New functions to generate EH info where we want it. (assemble_eh_integer): New function. * toplev.c (compile_file): Output module level exception table for non-ia64 targets. (main): Set exceptions_via_longjump and flag_new_exceptions based on IA64_UNWIND_INFO too. * varasm.c (assemble_eh_label): Generate a label via ASM_OUTPUT_EH_LABEL if it has been specified. (assemble_eh_align): Generate an alignment directive via ASM_OUTPUT_EH_ALIGN if it has been specified. (assemble_eh_label): Generate an integer value via ASM_OUTPUT_EH_type if they have been specified. * config/ia64/ia64.c (rtx_needs_barrier): Add flushrs. (ia64_init_builtins): Add __builtin_ia64_bsp and __builtin_ia64_flushrs. (ia64_expand_builtin): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and IA64_BUILTIN_FLUSHRS. * config/ia64/ia64.md (flushrs): New insn to flush the register stack. Add to unspec list. * config/ia64/crtbegin.asm (frame_object): Change size. (__do_frame_setup_aux): New function. * config/ia64/crtend.asm: call __do_frame_setup_aux. * config/ia64/t-ia64 (LIB2ADDEH): Add. * Makefile.in (LIB2ADDEH): Add. (LIB2ADD): Use LIB2ADDEH. Co-Authored-By: Andrew Haley <aph@cygnus.com> From-SVN: r34169
2000-05-25 17:21:51 +02:00
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
case IA64_BUILTIN_INFQ:
case IA64_BUILTIN_HUGE_VALQ:
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
{
REAL_VALUE_TYPE inf;
rtx tmp;
real_inf (&inf);
tmp = CONST_DOUBLE_FROM_REAL_VALUE (inf, mode);
tmp = validize_mem (force_const_mem (mode, tmp));
if (target == 0)
target = gen_reg_rtx (mode);
emit_move_insn (target, tmp);
return target;
}
case IA64_BUILTIN_FABSQ:
case IA64_BUILTIN_COPYSIGNQ:
return expand_call (exp, target, ignore);
2000-03-09 01:26:04 +01:00
default:
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
gcc_unreachable ();
2000-03-09 01:26:04 +01:00
}
stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.c (gr_register_operand): New. (fr_register_operand, grfr_register_operand): New. (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. (grfr_reg_or_8bit_operand): New. (gr_reg_or_0_operand): Rename from reg_or_0_operand and use gr_register_operand. (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. (gr_reg_or_8bit_and_adjusted_operand): Likewise. (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. (fr_reg_or_fp01_operand): Likewise. (not_postinc_memory_operand): New. (ia64_split_timode): Remove unused variables. (rtx_needs_barrier): Check arguments to cmpxchg. (builtin_description): Remove. (bdesc_2argsi, bdesc_2argdi): Remove. (ia64_init_builtins): Declare all builtins directly. (ia64_expand_fetch_and_op): Rewrite to be called from ia64_expand_builtin directly. Use expand_binop and co. (ia64_expand_op_and_fetch): Likewise. (ia64_expand_compare_and_swap): Likewise. (ia64_expand_binop_builtin): Remove. (ia64_expand_lock_test_and_set): New. (ia64_expand_lock_release): New. (ia64_expand_builtin): Use them. * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Update. * config/ia64/ia64.md (*): Use gr_register_operand and co. (mf): Indicate that we set memory as well as use it. (fetchadd_acq_si): Show memory being modified as well. (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. (val_compare_and_swap_si, val_compare_and_swap_di): Remove. (lock_test_and_set_si, lock_test_and_set_di): Remove. (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. * config/ia64/ia64intrin.h (*): Cast result to the appropriate return type. Pretty print definitions. From-SVN: r35956
2000-08-24 23:40:24 +02:00
return NULL_RTX;
2000-03-09 01:26:04 +01:00
}
/* For the HP-UX IA64 aggregate parameters are passed stored in the
most significant bits of the stack slot. */
enum direction
arc-protos.h (arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arc/arc-protos.h arc_select_cc_mode, gen_compare_reg): Wrap in RTX_CODE macro guard. * config/arm/pe.c (arm_dllexport_p, arm_dllimport_p, arm_dllexport_name_p, arm_dllimport_name_p, arm_mark_dllexport, arm_mark_dllimport, arm_pe_encode_section_info, arm_pe_unique_section): Use ISO-C function declarations. * config/c4x/c4x-c.c (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, c4x_pr_ignored): Likewise. * config/iq2000/iq2000.h (ASM_OUTPUT_SKIP): Fix format warning. * config/m68hc11/m68hc11.h (ASM_OUTPUT_EXTERNAL): Undef before defining. * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Likewise. * config/pdp11/pdp11.c (pdp11_output_function_epilogue): Likewise. (register_move_cost): Use ISO-C function declarations. * config/pdp11/pdp11.h (PRINT_OPERAND): Fix format warnings. * config/score/score-protos.h (score_declare_object): Add ATTRIBUTE_PRINTF_4. * config/score/score.h (ASM_DECLARE_OBJECT_NAME): Fix format warnings. * final.c (profile_function): Avoid empty if-bodies. * calls.c (must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Constify. * config/alpha/alpha-protos.h (function_value): Likewise. * config/alpha/alpha.c (alpha_return_in_memory, alpha_pass_by_reference, function_value, unicosmk_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arc/arc.c (arc_return_in_memory, arc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/arm/arm-protos.h (arm_return_in_memory, arm_pad_arg_upward, arm_function_value): Likewise. * config/arm/arm.c (arm_pass_by_reference, arm_promote_prototypes, arm_return_in_msb, arm_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, arm_function_value, arm_return_in_memory, arm_pad_arg_upward): Likewise. * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise. * config/avr/avr-protos.h (avr_function_value): Likewise. * config/avr/avr.c (avr_return_in_memory, gas_output_limited_string, gas_output_ascii, avr_function_value, avr_return_in_memory): Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference, bfin_return_in_memory, TARGET_PROMOTE_PROTOTYPES, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/cris/cris.c (cris_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS): Likewise. * config/crx/crx.c (crx_return_in_memory): Likewise. * config/darwin.c (function_base, machopic_function_base_name): Likewise. * config/fr30/fr30.c (fr30_must_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/frv/frv.c (frv_must_pass_in_stack): Likewise. * config/h8300/h8300.c (h8300_return_in_memory): Likewise. * config/i386/i386-protos.h (ix86_return_in_memory, ix86_sol10_return_in_memory): Likewise. * config/i386/i386.c (ix86_function_value, ix86_function_sseregparm, ix86_must_pass_in_stack, type_natural_mode, classify_argument, examine_argument, construct_container, ix86_pass_by_reference, function_value_32, function_value_64, ix86_function_value_1, return_in_memory_32, return_in_memory_64, return_in_memory_ms_64, ix86_return_in_memory, ix86_sol10_return_in_memory, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/ia64/ia64-protos.h (ia64_function_value, ia64_hpux_function_arg_padding): Likewise. * config/ia64/ia64.c (hfa_element_mode, ia64_return_in_memory, ia64_function_value, bundle_state_hash, bundle_state_eq_p, ia64_hpux_function_arg_padding): Likewise. * config/iq2000/iq2000-protos.h (function_arg, iq2000_function_value): Likewise. * config/iq2000/iq2000.c (iq2000_return_in_memory, iq2000_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg, iq2000_function_value): Likewise. * config/m32c/m32c-protos.h (m32c_function_value, m32c_promote_function_return): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference, m32c_promote_prototypes, m32c_promote_function_return, m32c_function_value): Likewise. * config/m32r/m32r.c (m32r_return_in_memory, m32r_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, m32r_in_small_data_p): Likewise. * config/m68hc11/m68hc11-protos.h (m68hc11_function_arg_padding): Likewise. * config/m68hc11/m68hc11.c (m68hc11_return_in_memory, m68hc11_function_arg_padding): Likewise. * config/m68k/m68k-protos.h (m68k_function_value): Likewise. * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES, m68k_function_value): Likewise. * config/mcore/mcore-protos.h (mcore_num_arg_regs, mcore_function_value): Likewise. * config/mcore/mcore.c (handle_structs_in_regs, mcore_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mcore_num_arg_regs, mcore_function_value): Likewise. * config/mips/mips-protos.h (mips_pad_arg_upward, mips_function_value): Likewise. * config/mips/mips.c (mips_fpr_return_fields, mips_return_in_msb, mips_return_in_memory, mips_pass_by_reference, mips_callee_copies, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, mips_pad_arg_upward, mips_function_value): Likewise. * config/mmix/mmix-protos.h (mmix_function_outgoing_value): Likewise. * config/mmix/mmix.c (mmix_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, mmix_function_outgoing_value, mmix_encode_section_info): Likewise. * config/mn10300/mn10300-protos.h (mn10300_function_value): Likewise. * config/mn10300/mn10300.c (mn10300_return_in_memory, mn10300_pass_by_reference, TARGET_PROMOTE_PROTOTYPES, mn10300_function_value): Likewise. * config/mt/mt-protos.h (mt_function_value): Likewise. * config/mt/mt.c (mt_pass_by_reference, mt_function_value, mt_pass_in_stack, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/pa/pa-protos.h (function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pa/pa.c (pa_pass_by_reference, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, function_arg_padding, function_value, pa_return_in_memory): Likewise. * config/pdp11/pdp11.c (pdp11_return_in_memory): Likewise. * config/rs6000/rs6000-protos.h (rs6000_function_value, function_arg_padding): Likewise. * config/rs6000/rs6000.c (rs6000_return_in_memory, rs6000_darwin64_record_arg_recurse, rs6000_darwin64_record_arg, rs6000_pass_by_reference, rs6000_must_pass_in_stack, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_padding, altivec_expand_dst_builtin, altivec_expand_builtin, rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, rs6000_common_init_builtins, rs6000_function_value): Likewise. * s390/s390-protos.h (s390_function_value): Likewise. * config/s390/s390.c (s390_function_arg_size, s390_pass_by_reference, s390_return_in_memory, s390_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Likewise. * config/score/score-protos.h (score_function_value): Likewise. * config/score/score.c (score_arg_partial_bytes, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, score_return_in_memory, score_pass_by_reference, score_add_offset, score_function_value): Likewise. * config/sh/sh-protos.h (sh_attr_renesas_p, sh_promote_prototypes): Likewise. * config/sh/sh.c (sh_return_in_memory, sh_pass_by_reference, sh_callee_copies, sh_promote_prototypes, shcompact_byref, sh_attr_renesas_p): Likewise. * config/sparc/sparc-protos.h (function_value, function_arg_padding): Likewise. * config/sparc/sparc.c (sparc_promote_prototypes, sparc_return_in_memory, sparc_pass_by_reference, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, function_arg_record_value_2, function_arg_record_value_1, function_arg_record_value, function_arg_record_value, function_arg_padding, function_value): Likewise. * config/spu/spu-protos.h (spu_function_value): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_return_in_memory, spu_function_value): Likewise. * config/stormy16/stormy16-protos.h (xstormy16_function_value): Likewise. * config/stormy16/stormy16.c (xstormy16_return_in_memory, xstormy16_function_value, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/v850/v850.c (v850_return_in_memory, v850_pass_by_reference, TARGET_PROMOTE_PROTOTYPES): Likewise. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): Likewise. * config/xtensa/xtensa.c (xtensa_return_in_msb, xtensa_return_in_memory, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES): Likewise. * explow.c (promote_mode, hard_function_value): Likewise. * expr.h (hard_function_value, promote_mode): Likewise. * function.c (aggregate_value_p): Likewise. * hooks.c (hook_bool_const_tree_true): New. * hooks.h (hook_bool_const_tree_true): New. * sdbout.c (SET_KNOWN_TYPE_TAG, plain_type_1): Constify. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_RETURN_IN_MSB): Likewise. * target.h (promote_function_args, promote_function_return, promote_prototypes, return_in_memory, return_in_msb, pass_by_reference, must_pass_in_stack, callee_copies, function_value): Likewise. * targhooks.c (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * targhooks.h (default_return_in_memory, hook_pass_by_reference_must_pass_in_stack, hook_callee_copies_named, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false, hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true, default_function_value): Likewise. * tree-ssa-structalias.c (const_equiv_class_label_t): New. (equiv_class_label_hash, equiv_class_label_eq): Constify. * tree-vectorizer.c (bb_in_loop_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree.h (struct tree_type, needs_to_live_in_memory, aggregate_value_p, must_pass_in_stack_var_size, must_pass_in_stack_var_size_or_pad): Likewise. * vmsdbgout.c (write_debug_addr, write_debug_delta4, write_debug_string, ASM_OUTPUT_DEBUG_STRING, write_rtnbeg, lookup_filename): Likewise. From-SVN: r127743
2007-08-23 17:49:56 +02:00
ia64_hpux_function_arg_padding (enum machine_mode mode, const_tree type)
{
/* Exception to normal case for structures/unions/etc. */
if (type && AGGREGATE_TYPE_P (type)
&& int_size_in_bytes (type) < UNITS_PER_WORD)
return upward;
/* Fall back to the default. */
return DEFAULT_FUNCTION_ARG_PADDING (mode, type);
}
/* Emit text to declare externally defined variables and functions, because
the Intel assembler does not support undefined externals. */
void
ia64_asm_output_external (FILE *file, tree decl, const char *name)
{
/* We output the name if and only if TREE_SYMBOL_REFERENCED is
set in order to avoid putting out names that are never really
used. */
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
{
/* maybe_assemble_visibility will return 1 if the assembler
visibility directive is output. */
int need_visibility = ((*targetm.binds_local_p) (decl)
&& maybe_assemble_visibility (decl));
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
#ifdef DO_CRTL_NAMES
DO_CRTL_NAMES;
#endif
/* GNU as does not need anything here, but the HP linker does
need something for external functions. */
if ((TARGET_HPUX_LD || !TARGET_GNU_AS)
&& TREE_CODE (decl) == FUNCTION_DECL)
(*targetm.asm_out.globalize_decl_name) (file, decl);
else if (need_visibility && !TARGET_GNU_AS)
(*targetm.asm_out.globalize_label) (file, name);
}
}
/* Set SImode div/mod functions, init_integral_libfuncs only initializes
modes of word_mode and larger. Rename the TFmode libfuncs using the
HPUX conventions. __divtf3 is used for XFmode. We need to keep it for
backward compatibility. */
static void
ia64_init_libfuncs (void)
{
set_optab_libfunc (sdiv_optab, SImode, "__divsi3");
set_optab_libfunc (udiv_optab, SImode, "__udivsi3");
set_optab_libfunc (smod_optab, SImode, "__modsi3");
set_optab_libfunc (umod_optab, SImode, "__umodsi3");
set_optab_libfunc (add_optab, TFmode, "_U_Qfadd");
set_optab_libfunc (sub_optab, TFmode, "_U_Qfsub");
set_optab_libfunc (smul_optab, TFmode, "_U_Qfmpy");
set_optab_libfunc (sdiv_optab, TFmode, "_U_Qfdiv");
set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg");
set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad");
set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad");
set_conv_libfunc (sext_optab, TFmode, XFmode, "_U_Qfcnvff_f80_to_quad");
set_conv_libfunc (trunc_optab, SFmode, TFmode, "_U_Qfcnvff_quad_to_sgl");
set_conv_libfunc (trunc_optab, DFmode, TFmode, "_U_Qfcnvff_quad_to_dbl");
set_conv_libfunc (trunc_optab, XFmode, TFmode, "_U_Qfcnvff_quad_to_f80");
set_conv_libfunc (sfix_optab, SImode, TFmode, "_U_Qfcnvfxt_quad_to_sgl");
set_conv_libfunc (sfix_optab, DImode, TFmode, "_U_Qfcnvfxt_quad_to_dbl");
set_conv_libfunc (sfix_optab, TImode, TFmode, "_U_Qfcnvfxt_quad_to_quad");
set_conv_libfunc (ufix_optab, SImode, TFmode, "_U_Qfcnvfxut_quad_to_sgl");
set_conv_libfunc (ufix_optab, DImode, TFmode, "_U_Qfcnvfxut_quad_to_dbl");
set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad");
set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
set_conv_libfunc (sfloat_optab, TFmode, TImode, "_U_Qfcnvxf_quad_to_quad");
/* HP-UX 11.23 libc does not have a function for unsigned
SImode-to-TFmode conversion. */
set_conv_libfunc (ufloat_optab, TFmode, DImode, "_U_Qfcnvxuf_dbl_to_quad");
}
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
/* Rename all the TFmode libfuncs using the HPUX conventions. */
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
static void
ia64_hpux_init_libfuncs (void)
{
ia64_init_libfuncs ();
/* The HP SI millicode division and mod functions expect DI arguments.
By turning them off completely we avoid using both libgcc and the
non-standard millicode routines and use the HP DI millicode routines
instead. */
set_optab_libfunc (sdiv_optab, SImode, 0);
set_optab_libfunc (udiv_optab, SImode, 0);
set_optab_libfunc (smod_optab, SImode, 0);
set_optab_libfunc (umod_optab, SImode, 0);
set_optab_libfunc (sdiv_optab, DImode, "__milli_divI");
set_optab_libfunc (udiv_optab, DImode, "__milli_divU");
set_optab_libfunc (smod_optab, DImode, "__milli_remI");
set_optab_libfunc (umod_optab, DImode, "__milli_remU");
/* HP-UX libc has TF min/max/abs routines in it. */
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
set_optab_libfunc (smin_optab, TFmode, "_U_Qfmin");
set_optab_libfunc (smax_optab, TFmode, "_U_Qfmax");
set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs");
/* ia64_expand_compare uses this. */
cmptf_libfunc = init_one_libfunc ("_U_Qfcmp");
/* These should never be used. */
set_optab_libfunc (eq_optab, TFmode, 0);
set_optab_libfunc (ne_optab, TFmode, 0);
set_optab_libfunc (gt_optab, TFmode, 0);
set_optab_libfunc (ge_optab, TFmode, 0);
set_optab_libfunc (lt_optab, TFmode, 0);
set_optab_libfunc (le_optab, TFmode, 0);
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
}
/* Rename the division and modulus functions in VMS. */
static void
ia64_vms_init_libfuncs (void)
{
set_optab_libfunc (sdiv_optab, SImode, "OTS$DIV_I");
set_optab_libfunc (sdiv_optab, DImode, "OTS$DIV_L");
set_optab_libfunc (udiv_optab, SImode, "OTS$DIV_UI");
set_optab_libfunc (udiv_optab, DImode, "OTS$DIV_UL");
set_optab_libfunc (smod_optab, SImode, "OTS$REM_I");
set_optab_libfunc (smod_optab, DImode, "OTS$REM_L");
set_optab_libfunc (umod_optab, SImode, "OTS$REM_UI");
set_optab_libfunc (umod_optab, DImode, "OTS$REM_UL");
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
abort_libfunc = init_one_libfunc ("decc$abort");
memcmp_libfunc = init_one_libfunc ("decc$memcmp");
#ifdef MEM_LIBFUNCS_INIT
MEM_LIBFUNCS_INIT;
#endif
}
/* Rename the TFmode libfuncs available from soft-fp in glibc using
the HPUX conventions. */
static void
ia64_sysv4_init_libfuncs (void)
{
ia64_init_libfuncs ();
/* These functions are not part of the HPUX TFmode interface. We
use them instead of _U_Qfcmp, which doesn't work the way we
expect. */
set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq");
set_optab_libfunc (ne_optab, TFmode, "_U_Qfne");
set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt");
set_optab_libfunc (ge_optab, TFmode, "_U_Qfge");
set_optab_libfunc (lt_optab, TFmode, "_U_Qflt");
set_optab_libfunc (le_optab, TFmode, "_U_Qfle");
/* We leave out _U_Qfmin, _U_Qfmax and _U_Qfabs since soft-fp in
glibc doesn't have them. */
}
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
/* Use soft-fp. */
static void
ia64_soft_fp_init_libfuncs (void)
{
}
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
static bool
ia64_vms_valid_pointer_mode (enum machine_mode mode)
{
return (mode == SImode || mode == DImode);
}
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
re PR target/26090 (IA-64 creates DT_TEXTREL binaries) PR target/26090 * target.h (targetm.asm.out.reloc_rw_mask): New. * target-def.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_OUT): Use it. * targhooks.c, targhooks.h (default_reloc_rw_mask): New. * varasm.c (categorize_decl_for_section): Remove shlib argument; use the new reloc_rw_mask target hook instead. (default_section_type_flags_1): Merge into... (default_section_type_flags): ... here. (decl_readonly_section_1): Merge into... (decl_readonly_section): ... here. (default_elf_select_section_1): Merge into... (default_elf_select_section): ... here. (default_unique_section_1): Merge into... (default_unique_section): ... here. (compute_reloc_for_rtx_1, compute_reloc_for_rtx): New. (default_select_rtx_section): Use it. (default_elf_select_rtx_section): Likewise. * output.h: Update to match. * doc/tm.texi (TARGET_ASM_RELOC_RW_MASK): New. * config/alpha/alpha.c (alpha_elf_reloc_rw_mask): New. (TARGET_ASM_RELOC_RW_MASK): New. * config/i386/i386.c (x86_64_elf_select_section): Adjust call to categorize_decl_for_section. (x86_64_elf_unique_section): Likewise. * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Remove. (TARGET_ASM_RELOC_RW_MASK): New. * config/ia64/ia64.c (ia64_rwreloc_select_section, ia64_rwreloc_unique_section, ia64_rwreloc_select_rtx_section): Remove. (ia64_hpux_reloc_rw_mask, ia64_reloc_rw_mask): New. (TARGET_RWRELOC): Remove. (ia64_section_type_flags): Adjust call to default_section_type_flags. * config/ia64/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Remove. (rs6000_elf_select_section, rs6000_elf_unique_section): Remove. (rs6000_elf_reloc_rw_mask, rs6000_xcoff_reloc_rw_mask): New. (rs6000_xcoff_select_section): Use decl_readonly_section. (rs6000_xcoff_section_type_flags): Use default_section_type_flags. * config/rs6000/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): Remove. (TARGET_SECTION_TYPE_FLAGS): Remove. * config/rs6000/xcoff.h (TARGET_ASM_RELOC_RW_MASK): New. From-SVN: r122781
2007-03-10 01:53:09 +01:00
/* For HPUX, it is illegal to have relocations in shared segments. */
static int
ia64_hpux_reloc_rw_mask (void)
{
return 3;
}
/* For others, relax this so that relocations to local data goes in
read-only segments, but we still cannot allow global relocations
in read-only segments. */
static int
ia64_reloc_rw_mask (void)
{
return flag_pic ? 3 : 2;
}
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
/* Return the section to use for X. The only special thing we do here
is to honor small data. */
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
static section *
ia64_select_rtx_section (enum machine_mode mode, rtx x,
unsigned HOST_WIDE_INT align)
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
{
if (GET_MODE_SIZE (mode) > 0
&& GET_MODE_SIZE (mode) <= ia64_section_threshold
&& !TARGET_NO_SDATA)
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
return sdata_section;
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
else
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
return default_elf_select_rtx_section (mode, x, align);
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
}
static unsigned int
ia64_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int flags = 0;
if (strcmp (name, ".sdata") == 0
|| strncmp (name, ".sdata.", 7) == 0
|| strncmp (name, ".gnu.linkonce.s.", 16) == 0
|| strncmp (name, ".sdata2.", 8) == 0
|| strncmp (name, ".gnu.linkonce.s2.", 17) == 0
|| strcmp (name, ".sbss") == 0
|| strncmp (name, ".sbss.", 6) == 0
|| strncmp (name, ".gnu.linkonce.sb.", 17) == 0)
flags = SECTION_SMALL;
#if TARGET_ABI_OPEN_VMS
if (decl && DECL_ATTRIBUTES (decl)
&& lookup_attribute ("common_object", DECL_ATTRIBUTES (decl)))
flags |= SECTION_VMS_OVERLAY;
#endif
re PR target/26090 (IA-64 creates DT_TEXTREL binaries) PR target/26090 * target.h (targetm.asm.out.reloc_rw_mask): New. * target-def.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_OUT): Use it. * targhooks.c, targhooks.h (default_reloc_rw_mask): New. * varasm.c (categorize_decl_for_section): Remove shlib argument; use the new reloc_rw_mask target hook instead. (default_section_type_flags_1): Merge into... (default_section_type_flags): ... here. (decl_readonly_section_1): Merge into... (decl_readonly_section): ... here. (default_elf_select_section_1): Merge into... (default_elf_select_section): ... here. (default_unique_section_1): Merge into... (default_unique_section): ... here. (compute_reloc_for_rtx_1, compute_reloc_for_rtx): New. (default_select_rtx_section): Use it. (default_elf_select_rtx_section): Likewise. * output.h: Update to match. * doc/tm.texi (TARGET_ASM_RELOC_RW_MASK): New. * config/alpha/alpha.c (alpha_elf_reloc_rw_mask): New. (TARGET_ASM_RELOC_RW_MASK): New. * config/i386/i386.c (x86_64_elf_select_section): Adjust call to categorize_decl_for_section. (x86_64_elf_unique_section): Likewise. * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Remove. (TARGET_ASM_RELOC_RW_MASK): New. * config/ia64/ia64.c (ia64_rwreloc_select_section, ia64_rwreloc_unique_section, ia64_rwreloc_select_rtx_section): Remove. (ia64_hpux_reloc_rw_mask, ia64_reloc_rw_mask): New. (TARGET_RWRELOC): Remove. (ia64_section_type_flags): Adjust call to default_section_type_flags. * config/ia64/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Remove. (rs6000_elf_select_section, rs6000_elf_unique_section): Remove. (rs6000_elf_reloc_rw_mask, rs6000_xcoff_reloc_rw_mask): New. (rs6000_xcoff_select_section): Use decl_readonly_section. (rs6000_xcoff_section_type_flags): Use default_section_type_flags. * config/rs6000/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): Remove. (TARGET_SECTION_TYPE_FLAGS): Remove. * config/rs6000/xcoff.h (TARGET_ASM_RELOC_RW_MASK): New. From-SVN: r122781
2007-03-10 01:53:09 +01:00
flags |= default_section_type_flags (decl, name, reloc);
return flags;
}
/* Returns true if FNTYPE (a FUNCTION_TYPE or a METHOD_TYPE) returns a
structure type and that the address of that type should be passed
in out0, rather than in r8. */
static bool
ia64_struct_retval_addr_is_first_parm_p (tree fntype)
{
tree ret_type = TREE_TYPE (fntype);
/* The Itanium C++ ABI requires that out0, rather than r8, be used
as the structure return address parameter, if the return value
type has a non-trivial copy constructor or destructor. It is not
clear if this same convention should be used for other
programming languages. Until G++ 3.4, we incorrectly used r8 for
these return values. */
return (abi_version_at_least (2)
&& ret_type
&& TYPE_MODE (ret_type) == BLKmode
&& TREE_ADDRESSABLE (ret_type)
&& strcmp (lang_hooks.name, "GNU C++") == 0);
}
/* Output the assembler code for a thunk function. THUNK_DECL is the
declaration for the thunk function itself, FUNCTION is the decl for
the target function. DELTA is an immediate constant offset to be
added to THIS. If VCALL_OFFSET is nonzero, the word at
*(*this + vcall_offset) should be added to THIS. */
static void
ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Likewise. (TARGET_ASM_OUT): Add them. * target.h (asm_out): Add output_mi_thunk and output_mi_vcall_thunk. * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/arm/arm-protos.h (arm_output_mi_thunk): Declare. * config/arm/arm.c (arm_output_mi_thunk): Define. * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/cris/cris.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/frv/frv.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/i386/i386-protos.h (x86_output_mi_thunk): Adjust prototype. (x86_output_mi_vcall_thunk): Declare. * config/i386/i386.c (override_options): Clear output_mi_vcall_thunk in 64-bit mode. (ix86_fntype_regparm): New function. (ix86_return_pops_args): Use it. (ia32_this_parameter): New function. (x86_output_mi_vcall_thunk): New function. (x86_output_mi_thunk): Use it * config/i386/unix.h (TARGET_ASM_OUTPUT_MI_THUNK): Adjust. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define. * config/i960/i960-protos.h (i960_output_mi_thunk): Declare. * config/i960/i960.c (i960_output_mi_thunk): New function. * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Adjust. * config/ia64/ia64-protos.h (ia64_output_mi_thunk): Declare. * config/ia64/ia64.c (ia64_output_mi_thunk): Define. * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/m68k-protos.h (m68k_output_mi_thunk): New function. * config/m68k/linux.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/netbsd-elf.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/mmix/mmix.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/pa/pa.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/rs6000/sysv4.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/s390/s390-protos.h (s390_output_mi_thunk): Declare. * config/s390/s390.c (s390_output_mi_thunk): Define. * config/s390/s390.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/vax/vax-protos.h (vax_output_mi_thunk): Declare. * config/vax/vax.c (vax_output_mi_thunk): Define. * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * doc/tm.texi: Adjust documentation. From-SVN: r58293
2002-10-19 01:35:40 +02:00
{
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
rtx this_rtx, insn, funexp;
unsigned int this_parmno;
unsigned int this_regno;
rtx delta_rtx;
reload_completed = 1;
bt-load.c: New file. 2003-06-18 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * bt-load.c: New file. * Makefile.in (OBJS): Include bt-load.o (bt-load.o): Add dependencies. * flags.h (flag_branch_target_load_optimize): Declare. (flag_branch_target_load_optimize2): Likewise. * hooks.c (hook_reg_class_void_no_regs): New function. (hook_bool_bool_false): Likewise. * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. * rtl.h (branch_target_load_optimize): Declare. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (TARGET_INITIALIZER): Include these. * target.h (struct gcc_target): Add branch_target_register_class and branch_target_register_callee_saved members. * toplev.c (enum dump_file_index): Add DFI_branch_target_load (dump_file) Add "tars" entry. (flag_branch_target_load_optimize): New variable. (flag_branch_target_load_optimize2): Likewise. (lang_independent_options): Add entries for new options. (rest_of_compilation): Call branch_target_load_optimize. * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. * doc/invoke.texi: Document -fbranch-target-load-optimize and -fbranch-target-load-optimize2. * rtl.h (epilogue_completed): Declare. * recog.c (epilogue_completed): New variable. * toplev.c (rest_of_compilation): Set it. * flow.c (mark_regs_live_at_end): Use it. * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * sh.c (shmedia_space_reserved_for_target_registers): New variable. (sh_target_reg_class): New function. (sh_optimize_target_register_callee_saved): Likwise. (shmedia_target_regs_stack_space): Likewise. (shmedia_reserve_space_for_target_registers_p): Likewise. (shmedia_target_regs_stack_adjust): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (calc_live_regs): If flag_branch_target_load_optimize2 and TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved for target registers, make sure that we save all target registers. (sh_expand_prologue, sh_expand_epilogue): Take target register optimizations into account. Collapse stack adjustments if that is beneficial. (initial_elimination_offset): Reserve space for target registers if necessary. * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r68165
2003-06-18 21:43:55 +02:00
epilogue_completed = 1;
/* Set things up as ia64_expand_prologue might. */
last_scratch_gr_reg = 15;
memset (&current_frame_info, 0, sizeof (current_frame_info));
current_frame_info.spill_cfa_off = -16;
current_frame_info.n_input_regs = 1;
current_frame_info.need_regstk = (TARGET_REG_NAMES != 0);
/* Mark the end of the (empty) prologue. */
rtl.h (emit_note): Remove FILE parameter. * rtl.h (emit_note): Remove FILE parameter. * emit-rtl.c (emit_line_note): Adjust emit_note call. (emit_note): Remove FILE parameter. Adjust. * builtins.c (expand_builtin_expect): Adjust emit_note call. * c-semantics.c (genrtl_scope_stmt): Likewise. (expand_stmt): Likewise. * cfglayout.c (reemit_insn_block_notes): Likewise. (duplicate_insn_chain): Likewise. * except.c (expand_eh_region_start, expand_eh_region_end, sjlj_emit_function_enter): Likewise. * explow.c (probe_stack_range): Likewise. * expr.c (emit_block_move_via_loop): Likewise. * function.c (init_function_start, expand_function_start, expand_function_end, thread_prologue_and_epilogue_insns): Likewise. * integrate.c (expand_inline_function, copy_insn_list): Likewise. * reg-stack.c (compensate_edge): Likewise. * reload1.c (reload): Likewise. * rtlanal.c (hoist_insn_to_edge): Likewise. * stmt.c (expand_fixup, expand_start_loop, expand_start_null_loop, expand_loop_continue_here, expand_end_loop, expand_continue_loop, expand_exit_loop_top_cond, expand_value_return, expand_start_bindings_and_block, expand_end_bindings, expand_decl_cleanup, expand_start_case): Likewise. * unroll.c (copy_loop_body * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise. * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_emit_eh_toc_restore, rs6000_emit_allocate_stack, rs6000_output_function_prologue, rs6000_output_function_epilogue, rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * ada/misc.c (record_code_position): Likewise. From-SVN: r68561
2003-06-27 11:49:44 +02:00
emit_note (NOTE_INSN_PROLOGUE_END);
/* Figure out whether "this" will be the first parameter (the
typical case) or the second parameter (as happens when the
virtual function returns certain class objects). */
this_parmno
= (ia64_struct_retval_addr_is_first_parm_p (TREE_TYPE (thunk))
? 1 : 0);
this_regno = IN_REG (this_parmno);
if (!TARGET_REG_NAMES)
reg_names[this_regno] = ia64_reg_numbers[this_parmno];
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
this_rtx = gen_rtx_REG (Pmode, this_regno);
/* Apply the constant offset, if required. */
delta_rtx = GEN_INT (delta);
if (TARGET_ILP32)
{
rtx tmp = gen_rtx_REG (ptr_mode, this_regno);
REG_POINTER (tmp) = 1;
if (delta && satisfies_constraint_I (delta_rtx))
{
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
emit_insn (gen_ptr_extend_plus_imm (this_rtx, tmp, delta_rtx));
delta = 0;
}
else
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
emit_insn (gen_ptr_extend (this_rtx, tmp));
}
if (delta)
{
if (!satisfies_constraint_I (delta_rtx))
{
rtx tmp = gen_rtx_REG (Pmode, 2);
emit_move_insn (tmp, delta_rtx);
delta_rtx = tmp;
}
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
emit_insn (gen_adddi3 (this_rtx, this_rtx, delta_rtx));
}
/* Apply the offset from the vtable, if required. */
if (vcall_offset)
{
rtx vcall_offset_rtx = GEN_INT (vcall_offset);
rtx tmp = gen_rtx_REG (Pmode, 2);
if (TARGET_ILP32)
{
rtx t = gen_rtx_REG (ptr_mode, 2);
REG_POINTER (t) = 1;
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
emit_move_insn (t, gen_rtx_MEM (ptr_mode, this_rtx));
if (satisfies_constraint_I (vcall_offset_rtx))
{
emit_insn (gen_ptr_extend_plus_imm (tmp, t, vcall_offset_rtx));
vcall_offset = 0;
}
else
emit_insn (gen_ptr_extend (tmp, t));
}
else
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
emit_move_insn (tmp, gen_rtx_MEM (Pmode, this_rtx));
if (vcall_offset)
{
if (!satisfies_constraint_J (vcall_offset_rtx))
{
rtx tmp2 = gen_rtx_REG (Pmode, next_scratch_gr_reg ());
emit_move_insn (tmp2, vcall_offset_rtx);
vcall_offset_rtx = tmp2;
}
emit_insn (gen_adddi3 (tmp, tmp, vcall_offset_rtx));
}
if (TARGET_ILP32)
emit_insn (gen_zero_extendsidi2 (tmp, gen_rtx_MEM (ptr_mode, tmp)));
else
emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
alpha.c (alpha_preferred_reload_class, [...]): Avoid C++ keywords. * config/alpha/alpha.c (alpha_preferred_reload_class, alpha_secondary_reload, alpha_emit_set_const_1, function_value, alpha_output_mi_thunk_osf): Avoid C++ keywords. * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr-protos.h (preferred_reload_class, test_hard_reg_class, avr_simplify_comparison_p, out_shift_with_cnt, class_max_nregs): Likewise. * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p, output_movqi, output_movhi, output_movsisf, out_shift_with_cnt, preferred_reload_class, test_hard_reg_class): Likewise. * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok, bfin_memory_move_cost, bfin_secondary_reload, bfin_output_mi_thunk): Likewise. * config/crx/crx.c (crx_secondary_reload_class, crx_memory_move_cost): Likewise. * config/frv/frv-protos.h (frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg, frv_secondary_reload_class, frv_class_likely_spilled_p, frv_class_max_nregs): Likewise. * config/h8300/h8300.c (h8300_classify_operand, h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count): Likewise. * config/i386/winnt.c (i386_pe_declare_function_type): Likewise. * config/ia64/ia64.c (ia64_preferred_reload_class, ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise. * config/iq2000/iq2000.c (gen_int_relational): Likewise. * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare): Likewise. * config/m68hc11/m68hc11.c (preferred_reload_class, m68hc11_memory_move_cost): Likewise. * config/mcore/mcore.c (mcore_secondary_reload_class, mcore_reload_class): Likewise. * config/mips/mips.c (mips_hard_regno_mode_ok_p, mips_class_max_nregs, mips_cannot_change_mode_class, mips_preferred_reload_class, mips_secondary_reload_class, mips_output_mi_thunk): Likewise. * config/mmix/mmix.c (mmix_preferred_reload_class, mmix_preferred_output_reload_class, mmix_secondary_reload_class): Likewise. * config/mn10300/mn10300.c (mn10300_secondary_reload_class): Likewise. * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions, pa_can_combine_p, pa_cannot_change_mode_class): Likewise. * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/rs6000/rs6000.c (paired_expand_vector_init, rs6000_secondary_reload_class, rs6000_output_mi_thunk, compare_section_name, rs6000_memory_move_cost): Likewise. * config/s390/s390.c (s390_emit_compare_and_swap, s390_preferred_reload_class, s390_secondary_reload, legitimize_pic_address, legitimize_tls_address, legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic, s390_class_max_nregs): Likewise. * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. * config/s390/s390.md: Likewise. * config/score/score-protos.h (score_secondary_reload_class, score_preferred_reload_class): Likewise. * config/score/score.c (score_preferred_reload_class, score_secondary_reload_class): Likewise. * config/score/score3.c (score3_output_mi_thunk, score3_preferred_reload_class, score3_secondary_reload_class, score3_hard_regno_mode_ok): Likewise. * config/score/score3.h (score3_preferred_reload_class, score3_secondary_reload_class): Likewise. * config/score/score7.c (score7_output_mi_thunk, score7_preferred_reload_class, score7_secondary_reload_class, score7_hard_regno_mode_ok): Likewise. * config/score/score7.h (score7_preferred_reload_class, score7_secondary_reload_class): Likewise. * config/sh/sh.c (prepare_move_operands, output_far_jump, output_branchy_insn, add_constant, gen_block_redirect, sh_insn_length_adjustment, sh_cannot_change_mode_class, sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi, xstormy16_output_cbranch_si, xstormy16_secondary_reload_class, xstormy16_preferred_reload_class): Likewise. * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap, xtensa_expand_atomic, override_options, xtensa_preferred_reload_class, xtensa_secondary_reload_class): Likewise. * reorg.c (try_merge_delay_insns): Likewise. * tree.c (merge_dllimport_decl_attributes): Likewise. * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA. From-SVN: r138813
2008-08-06 18:12:51 +02:00
emit_insn (gen_adddi3 (this_rtx, this_rtx, tmp));
}
/* Generate a tail call to the target function. */
if (! TREE_USED (function))
{
assemble_external (function);
TREE_USED (function) = 1;
}
funexp = XEXP (DECL_RTL (function), 0);
funexp = gen_rtx_MEM (FUNCTION_MODE, funexp);
ia64_expand_call (NULL_RTX, funexp, NULL_RTX, 1);
insn = get_last_insn ();
SIBLING_CALL_P (insn) = 1;
/* Code generation for calls relies on splitting. */
reload_completed = 1;
bt-load.c: New file. 2003-06-18 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * bt-load.c: New file. * Makefile.in (OBJS): Include bt-load.o (bt-load.o): Add dependencies. * flags.h (flag_branch_target_load_optimize): Declare. (flag_branch_target_load_optimize2): Likewise. * hooks.c (hook_reg_class_void_no_regs): New function. (hook_bool_bool_false): Likewise. * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. * rtl.h (branch_target_load_optimize): Declare. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (TARGET_INITIALIZER): Include these. * target.h (struct gcc_target): Add branch_target_register_class and branch_target_register_callee_saved members. * toplev.c (enum dump_file_index): Add DFI_branch_target_load (dump_file) Add "tars" entry. (flag_branch_target_load_optimize): New variable. (flag_branch_target_load_optimize2): Likewise. (lang_independent_options): Add entries for new options. (rest_of_compilation): Call branch_target_load_optimize. * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. * doc/invoke.texi: Document -fbranch-target-load-optimize and -fbranch-target-load-optimize2. * rtl.h (epilogue_completed): Declare. * recog.c (epilogue_completed): New variable. * toplev.c (rest_of_compilation): Set it. * flow.c (mark_regs_live_at_end): Use it. * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * sh.c (shmedia_space_reserved_for_target_registers): New variable. (sh_target_reg_class): New function. (sh_optimize_target_register_callee_saved): Likwise. (shmedia_target_regs_stack_space): Likewise. (shmedia_reserve_space_for_target_registers_p): Likewise. (shmedia_target_regs_stack_adjust): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (calc_live_regs): If flag_branch_target_load_optimize2 and TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved for target registers, make sure that we save all target registers. (sh_expand_prologue, sh_expand_epilogue): Take target register optimizations into account. Collapse stack adjustments if that is beneficial. (initial_elimination_offset): Reserve space for target registers if necessary. * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r68165
2003-06-18 21:43:55 +02:00
epilogue_completed = 1;
try_split (PATTERN (insn), insn, 0);
emit_barrier ();
/* Run just enough of rest_of_compilation to get the insns emitted.
There's not really enough bulk here to make other passes such as
instruction scheduling worth while. Note that use_thunk calls
assemble_start_function and assemble_end_function. */
alpha.c (alpha_output_mi_thunk_osf): Use insn_locators_alloc instead of insn_locators_initialize... * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Use insn_locators_alloc instead of insn_locators_initialize; call reset_block_changes. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/sh/sh.c (sparc_output_mi_thunk): Likewise. * config/is64/ia64.c (ia64_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (th_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * cfglyaout.c (set_curr_insn_source_location, set_curr_insn_block): tolerate uninitialized locator info. Re-apply: * function.c (init_function_start): Don't init line number info. (expand_function_end): Update. (reset_block_changes, record_block_change, finalize_block_changes, check_block_change, free_block_changes): Kill. * function.h (reset_block_changes, record_block_change, finalize_block_changes, check_block_change, free_block_changes): Remove prototypes. (struct function): Remove ib_boundaries_block. * emit-rtl.c (make_insn_raw, make_jump_insn_raw, make_call_insn_raw): Use curr_insn_locator to initialize locator. (emit_line_note): Remove. * cfgexpand.c (expand_gimple_cond_expr): Update. (construct_exit_block): Likewise. (tree_expand_cfg): Initialize/finalize locators. * expr.c (expand_expr_real): Update. * cfglayout.c (line_locators_locs, line_locators_lines, file_locators_locs, file_locators_files): Remove. (set_block_levels): Move to cfgexpand.c. (insn_locators_initialize): Remove. (pass_insn_locators_initialize): Remove. (locations_locators_locs, locations_locators_vals): New static vars. (curr_location, last_location, curr_block, last_block, curr_rtl_loc): Likewise. (insn_locators_alloc, insn_locators_finalize, set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator): New functions. (locator_location): New. (locator_line, locator_file): Rewrite. * rtl.h (emit_line_note): Kill. (insn_locators_alloc, insn_locators_finalize, set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator): Declare. * tree-inline.c (initialize_cfun): Do not initialize ib_boundaries_block. * passes.c (pass_insn_locators_initialize): Remove. From-SVN: r124258
2007-04-28 10:20:08 +02:00
insn_locators_alloc ();
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
emit_all_insn_group_barriers (NULL);
insn = get_insns ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
reload_completed = 0;
bt-load.c: New file. 2003-06-18 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * bt-load.c: New file. * Makefile.in (OBJS): Include bt-load.o (bt-load.o): Add dependencies. * flags.h (flag_branch_target_load_optimize): Declare. (flag_branch_target_load_optimize2): Likewise. * hooks.c (hook_reg_class_void_no_regs): New function. (hook_bool_bool_false): Likewise. * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. * rtl.h (branch_target_load_optimize): Declare. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (TARGET_INITIALIZER): Include these. * target.h (struct gcc_target): Add branch_target_register_class and branch_target_register_callee_saved members. * toplev.c (enum dump_file_index): Add DFI_branch_target_load (dump_file) Add "tars" entry. (flag_branch_target_load_optimize): New variable. (flag_branch_target_load_optimize2): Likewise. (lang_independent_options): Add entries for new options. (rest_of_compilation): Call branch_target_load_optimize. * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. * doc/invoke.texi: Document -fbranch-target-load-optimize and -fbranch-target-load-optimize2. * rtl.h (epilogue_completed): Declare. * recog.c (epilogue_completed): New variable. * toplev.c (rest_of_compilation): Set it. * flow.c (mark_regs_live_at_end): Use it. * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * sh.c (shmedia_space_reserved_for_target_registers): New variable. (sh_target_reg_class): New function. (sh_optimize_target_register_callee_saved): Likwise. (shmedia_target_regs_stack_space): Likewise. (shmedia_reserve_space_for_target_registers_p): Likewise. (shmedia_target_regs_stack_adjust): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (calc_live_regs): If flag_branch_target_load_optimize2 and TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved for target registers, make sure that we save all target registers. (sh_expand_prologue, sh_expand_epilogue): Take target register optimizations into account. Collapse stack adjustments if that is beneficial. (initial_elimination_offset): Reserve space for target registers if necessary. * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r68165
2003-06-18 21:43:55 +02:00
epilogue_completed = 0;
target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Likewise. (TARGET_ASM_OUT): Add them. * target.h (asm_out): Add output_mi_thunk and output_mi_vcall_thunk. * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/arm/arm-protos.h (arm_output_mi_thunk): Declare. * config/arm/arm.c (arm_output_mi_thunk): Define. * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/cris/cris.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/frv/frv.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/i386/i386-protos.h (x86_output_mi_thunk): Adjust prototype. (x86_output_mi_vcall_thunk): Declare. * config/i386/i386.c (override_options): Clear output_mi_vcall_thunk in 64-bit mode. (ix86_fntype_regparm): New function. (ix86_return_pops_args): Use it. (ia32_this_parameter): New function. (x86_output_mi_vcall_thunk): New function. (x86_output_mi_thunk): Use it * config/i386/unix.h (TARGET_ASM_OUTPUT_MI_THUNK): Adjust. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define. * config/i960/i960-protos.h (i960_output_mi_thunk): Declare. * config/i960/i960.c (i960_output_mi_thunk): New function. * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Adjust. * config/ia64/ia64-protos.h (ia64_output_mi_thunk): Declare. * config/ia64/ia64.c (ia64_output_mi_thunk): Define. * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/m68k-protos.h (m68k_output_mi_thunk): New function. * config/m68k/linux.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/netbsd-elf.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/mmix/mmix.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/pa/pa.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/rs6000/sysv4.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/s390/s390-protos.h (s390_output_mi_thunk): Declare. * config/s390/s390.c (s390_output_mi_thunk): Define. * config/s390/s390.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/vax/vax-protos.h (vax_output_mi_thunk): Declare. * config/vax/vax.c (vax_output_mi_thunk): Define. * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * doc/tm.texi: Adjust documentation. From-SVN: r58293
2002-10-19 01:35:40 +02:00
}
/* Worker function for TARGET_STRUCT_VALUE_RTX. */
static rtx
ia64_struct_value_rtx (tree fntype,
int incoming ATTRIBUTE_UNUSED)
{
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
if (TARGET_ABI_OPEN_VMS ||
(fntype && ia64_struct_retval_addr_is_first_parm_p (fntype)))
return NULL_RTX;
return gen_rtx_REG (Pmode, GR_REG (8));
}
static bool
ia64_scalar_mode_supported_p (enum machine_mode mode)
{
switch (mode)
{
case QImode:
case HImode:
case SImode:
case DImode:
case TImode:
return true;
case SFmode:
case DFmode:
case XFmode:
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
case RFmode:
return true;
case TFmode:
longlong.h (sub_ddmmss): New for ia64. gcc/ 2009-02-12 Uros Bizjak <ubizjak@gmail.com> * longlong.h (sub_ddmmss): New for ia64. Ported from GMP 4.2. (umul_ppmm): Likewise. (count_leading_zeros): Likewise. (count_trailing_zeros): Likewise. (UMUL_TIME): Likewise. 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Add ia64/t-fprules-softfp soft-fp/t-softfp to tmake_file for ia64*-*-linux*. * config/ia64/ia64.c (ia64_soft_fp_init_libfuncs): New. (ia64_expand_compare): Use HPUX library for TFmode only for HPUX. (ia64_builtins): Add IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. (ia64_init_builtins): Initialize __builtin_infq, __builtin_fabsq and __builtin_copysignq if not HPUX. (ia64_expand_builtin): Handle IA64_BUILTIN_COPYSIGNQ, IA64_BUILTIN_FABSQ and IA64_BUILTIN_INFQ. * config/ia64/lib1funcs.asm (__divtf3): Define only if SHARED is defined. (__fixtfti): Likewise. (__fixunstfti): Likewise. (__floattitf): Likewise. * config/ia64/libgcc-glibc.ver: New. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/sfp-machine.h: Likewise. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): New. (LIBGCC2_TF_CEXT): Likewise. (TF_SIZE): Likewise. (TARGET_INIT_LIBFUNCS): Likewise. * config/ia64/t-glibc: Add $(srcdir)/config/ia64/libgcc-glibc.ver to SHLIB_MAPFILES. libgcc/ 2009-02-12 H.J. Lu <hongjiu.lu@intel.com> * config.host: Add ia64/t-fprules-softfp ia64/t-softfp-compat to tmake_file for ia64*-*-linux*. * Makefile.in (gen-hide-list): Ignore .*_compat and .*@.*. * config/ia64/__divxf3.asm: New. * config/ia64/_fixtfdi.asm: Likewise. * config/ia64/_fixunstfdi.asm: Likewise. * config/ia64/_floatditf.asm: Likewise. * config/ia64/t-fprules-softfp: Likewise. * config/ia64/t-softfp-compat: Likewise. * config/ia64/tf-signs.c: Likewise. From-SVN: r144130
2009-02-12 17:30:53 +01:00
return true;
default:
return false;
}
}
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
static bool
ia64_vector_mode_supported_p (enum machine_mode mode)
{
switch (mode)
{
case V8QImode:
case V4HImode:
case V2SImode:
return true;
case V2SFmode:
return true;
default:
return false;
}
}
/* Implement the FUNCTION_PROFILER macro. */
void
ia64_output_function_profiler (FILE *file, int labelno)
{
bool indirect_call;
/* If the function needs a static chain and the static chain
register is r15, we use an indirect call so as to bypass
the PLT stub in case the executable is dynamically linked,
because the stub clobbers r15 as per 5.3.6 of the psABI.
We don't need to do that in non canonical PIC mode. */
if (cfun->static_chain_decl && !TARGET_NO_PIC && !TARGET_AUTO_PIC)
{
gcc_assert (STATIC_CHAIN_REGNUM == 15);
indirect_call = true;
}
else
indirect_call = false;
if (TARGET_GNU_AS)
fputs ("\t.prologue 4, r40\n", file);
else
fputs ("\t.prologue\n\t.save ar.pfs, r40\n", file);
fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", file);
if (NO_PROFILE_COUNTERS)
fputs ("\tmov out3 = r0\n", file);
else
{
char buf[20];
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
if (TARGET_AUTO_PIC)
fputs ("\tmovl out3 = @gprel(", file);
else
fputs ("\taddl out3 = @ltoff(", file);
assemble_name (file, buf);
if (TARGET_AUTO_PIC)
fputs (")\n", file);
else
fputs ("), r1\n", file);
}
if (indirect_call)
fputs ("\taddl r14 = @ltoff(@fptr(_mcount)), r1\n", file);
fputs ("\t;;\n", file);
fputs ("\t.save rp, r42\n", file);
fputs ("\tmov out2 = b0\n", file);
if (indirect_call)
fputs ("\tld8 r14 = [r14]\n\t;;\n", file);
fputs ("\t.body\n", file);
fputs ("\tmov out1 = r1\n", file);
if (indirect_call)
{
fputs ("\tld8 r16 = [r14], 8\n\t;;\n", file);
fputs ("\tmov b6 = r16\n", file);
fputs ("\tld8 r1 = [r14]\n", file);
fputs ("\tbr.call.sptk.many b0 = b6\n\t;;\n", file);
}
else
fputs ("\tbr.call.sptk.many b0 = _mcount\n\t;;\n", file);
}
static GTY(()) rtx mcount_func_rtx;
static rtx
gen_mcount_func_rtx (void)
{
if (!mcount_func_rtx)
mcount_func_rtx = init_one_libfunc ("_mcount");
return mcount_func_rtx;
}
void
ia64_profile_hook (int labelno)
{
rtx label, ip;
if (NO_PROFILE_COUNTERS)
label = const0_rtx;
else
{
char buf[30];
const char *label_name;
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf));
label = gen_rtx_SYMBOL_REF (Pmode, label_name);
SYMBOL_REF_FLAGS (label) = SYMBOL_FLAG_LOCAL;
}
ip = gen_reg_rtx (Pmode);
emit_insn (gen_ip_value (ip));
emit_library_call (gen_mcount_func_rtx (), LCT_NORMAL,
VOIDmode, 3,
gen_rtx_REG (Pmode, BR_REG (0)), Pmode,
ip, Pmode,
label, Pmode);
}
/* Return the mangling of TYPE if it is an extended fundamental type. */
static const char *
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
ia64_mangle_type (const_tree type)
{
alpha.c (alpha_mangle_fundamental_type): Rename to... gcc/ * config/alpha/alpha.c (alpha_mangle_fundamental_type): Rename to... (alpha_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/arm/arm-protos.h (arm_mangle_type): Add prototype. * config/arm/arm.c (TARGET_MANGLE_TYPE): Define target hook. (arm_init_neon_builtins): Fix comment. (arm_mangle_map_entry): New. (arm_mangle_map): New. (arm_mangle_type): New. * config/i386/i386.c (ix86_mangle_fundamental_type): Rename to... (ix86_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/ia64/ia64.c (ia64_mangle_fundamental_type): Rename to... (ia64_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/rs6000/rs6000.c (rs6000_mangle_fundamental_type): Rename to... (rs6000_mangle_type): This. Use TYPE_MAIN_VARIANT. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/s390/s390.c (s390_mangle_fundamental_type): Rename to... (s390_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/sparc/sparc.c (sparc_mangle_fundamental_type): Rename to... (sparc_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * cp/mangle.c (write_type): Call mangle_type target hook on all types before mangling. Use original type, not main variant, as argument. * target-def.h (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename hook to... (TARGET_MANGLE_TYPE): This. * target.h (gcc_target): Rename mangle_fundamental_type to mangle_type. * doc/tm.texi (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename section to... (TARGET_MANGLE_TYPE): This. Note slightly different semantics. Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com> From-SVN: r126917
2007-07-25 17:43:04 +02:00
type = TYPE_MAIN_VARIANT (type);
if (TREE_CODE (type) != VOID_TYPE && TREE_CODE (type) != BOOLEAN_TYPE
&& TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE)
return NULL;
/* On HP-UX, "long double" is mangled as "e" so __float128 is
mangled as "e". */
if (!TARGET_HPUX && TYPE_MODE (type) == TFmode)
return "g";
/* On HP-UX, "e" is not available as a mangling of __float80 so use
an extended mangling. Elsewhere, "e" is available since long
double is 80 bits. */
if (TYPE_MODE (type) == XFmode)
return TARGET_HPUX ? "u9__float80" : "e";
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
if (TYPE_MODE (type) == RFmode)
return "u7__fpreg";
return NULL;
}
/* Return the diagnostic message string if conversion from FROMTYPE to
TOTYPE is not allowed, NULL otherwise. */
static const char *
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
ia64_invalid_conversion (const_tree fromtype, const_tree totype)
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
{
/* Reject nontrivial conversion to or from __fpreg. */
if (TYPE_MODE (fromtype) == RFmode
&& TYPE_MODE (totype) != RFmode
&& TYPE_MODE (totype) != VOIDmode)
return N_("invalid conversion from %<__fpreg%>");
if (TYPE_MODE (totype) == RFmode
&& TYPE_MODE (fromtype) != RFmode)
return N_("invalid conversion to %<__fpreg%>");
return NULL;
}
/* Return the diagnostic message string if the unary operation OP is
not permitted on TYPE, NULL otherwise. */
static const char *
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
ia64_invalid_unary_op (int op, const_tree type)
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
{
/* Reject operations on __fpreg other than unary + or &. */
if (TYPE_MODE (type) == RFmode
&& op != CONVERT_EXPR
&& op != ADDR_EXPR)
return N_("invalid operation on %<__fpreg%>");
return NULL;
}
/* Return the diagnostic message string if the binary operation OP is
not permitted on TYPE1 and TYPE2, NULL otherwise. */
static const char *
alpha.c (alpha_mangle_type, [...]): Constify. * config/alpha/alpha.c (alpha_mangle_type, decl_has_samegp, alpha_in_small_data_p, alpha_split_complex_arg, alpha_stdarg_optimize_hook, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Constify. * config/arm/arm-protos.h (arm_mangle_type): Likewise. * config/arm/arm.c (arm_comp_type_attributes, arm_mangle_type): Likewise. * config/bfin/bfin.c (funkind, bfin_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/darwin-protos.h (darwin_binds_local_p): Likewise. * config/darwin.c (darwin_binds_local_p): Likewise. * config/frv/frv.c (frv_string_begins_with, frv_in_small_data_p): Likewise. * config/i386/i386-protos.h (i386_pe_binds_local_p, i386_pe_valid_dllimport_attribute_p): Likewise. * config/i386/i386.c (ix86_function_regparm, ix86_comp_type_attributes, ix86_ms_bitfield_layout_p, x86_can_output_mi_thunk, ix86_mangle_type, TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. * config/i386/winnt.c (i386_pe_valid_dllimport_attribute_p, i386_pe_binds_local_p): Likewise. * config/ia64/ia64.c (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, ia64_needs_block_p, ia64_in_small_data_p, ia64_mangle_type, ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/m32c/m32c.c (m32c_comp_type_attributes): Likewise. * config/m32r/m32r.c (m32r_in_small_data_p): Likewise. * config/m68k/m68k.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/mips/mips.c (mips_use_blocks_for_constant_p, mips_in_small_data_p, mips_use_anchors_for_symbol_p, mips_comp_type_attributes, TARGET_ASM_CAN_OUTPUT_MI_THUNK, mips_near_type_p, mips_far_type_p, mips_global_symbol_p, mips_symbol_binds_local_p, mips_classify_symbol): Likewise. * config/pa/pa.c (pa_commutative_p): Likewise. * config/rs6000/rs6000-protos.h (rs6000_elf_in_small_data_p): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop, rs6000_ms_bitfield_layout_p, rs6000_mangle_type, rs6000_use_blocks_for_constant_p, rs6000_vector_alignment_reachable, rs6000_is_opaque_type, invalid_arg_for_unprototyped_fn, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_SPLIT_COMPLEX_ARG, rs6000_elf_in_small_data_p): Likewise. * config/s390/s390.c (s390_mangle_type, TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_INVALID_WITHIN_DOLOOP): Likewise. * config/score/score.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK, th_in_small_data_p): Likewise. * config/sh/sh.c (sh_ms_bitfield_layout_p, sh_dwarf_calling_convention, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Likewise. * config/sparc/sparc.c (sparc_can_output_mi_thunk, sparc_mangle_type): Likewise. * config/spu/spu.c (spu_vector_alignment_reachable): Likewise. * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): Likewise. * emit-rtl.c (const_fixed_htab_hash, const_fixed_htab_eq): Likewise. * hooks.c (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (default_can_output_mi_thunk_no_vcall): Constify. * hooks.h (hook_bool_mode_rtx_false, hook_bool_mode_rtx_true, hook_bool_tree_hwi_hwi_tree_false, hook_bool_tree_hwi_hwi_tree_true, hook_int_tree_0, hook_int_tree_tree_1, hook_constcharptr_tree_null, hook_constcharptr_rtx_null, hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Delete. (hook_bool_mode_const_rtx_false, hook_bool_mode_const_rtx_true, hook_bool_const_tree_hwi_hwi_const_tree_false, hook_bool_const_tree_hwi_hwi_const_tree_true, hook_int_const_tree_0, hook_int_const_tree_const_tree_1, hook_constcharptr_const_tree_null, hook_constcharptr_const_rtx_null, hook_constcharptr_const_tree_const_tree_null, hook_constcharptr_int_const_tree_null, hook_constcharptr_int_const_tree_const_tree_null): New. (default_can_output_mi_thunk_no_vcall): Constify. * integrate.c (function_attribute_inlinable_p): Likewise. * integrate.h (function_attribute_inlinable_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * output.h (decl_readonly_section, categorize_decl_for_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Likewise. * rtl.h (rtx_renumbered_equal_p, decl_default_tls_model): Likewise. * target-def.h (TARGET_ASM_CAN_OUTPUT_MI_THUNK, TARGET_VALID_DLLIMPORT_ATTRIBUTE_P, TARGET_VECTOR_OPAQUE_P, TARGET_COMMUTATIVE_P, TARGET_USE_BLOCKS_FOR_CONSTANT_P, TARGET_COMP_TYPE_ATTRIBUTES, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P, TARGET_MS_BITFIELD_LAYOUT_P, TARGET_MANGLE_TYPE, TARGET_IN_SMALL_DATA_P, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_DWARF_CALLING_CONVENTION): Likewise. * target.h (can_output_mi_thunk, needs_block_p, first_cycle_multipass_dfa_lookahead_guard_spec, vector_alignment_reachable, comp_type_attributes, function_attribute_inlinable_p, ms_bitfield_layout_p, mangle_type, commutative_p, use_blocks_for_constant_p, use_anchors_for_symbol_p, in_small_data_p, binds_local_p, vector_opaque_p, dwarf_calling_convention, stdarg_optimize_hook, invalid_within_doloop, valid_dllimport_attribute_p, split_complex_arg, invalid_arg_for_unprototyped_fn, invalid_conversion, invalid_unary_op, invalid_binary_op): Likewise. * targhooks.c (default_invalid_within_doloop, hook_invalid_arg_for_unprototyped_fn, default_builtin_vector_alignment_reachable): Likewise. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * targhooks.h (default_invalid_within_doloop, default_builtin_vector_alignment_reachable, hook_invalid_arg_for_unprototyped_fn): Constify. (hook_bool_rtx_commutative_p): Delete. (hook_bool_const_rtx_commutative_p): New. * varasm.c (bss_initializer_p, decl_default_tls_model, categorize_decl_for_section, decl_readonly_section, default_use_anchors_for_symbol_p, default_binds_local_p, default_binds_local_p_1): Constify. From-SVN: r127785
2007-08-24 21:00:59 +02:00
ia64_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree type2)
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
{
/* Reject operations on __fpreg. */
if (TYPE_MODE (type1) == RFmode || TYPE_MODE (type2) == RFmode)
return N_("invalid operation on %<__fpreg%>");
return NULL;
}
/* Implement overriding of the optimization options. */
void
ia64_optimization_options (int level ATTRIBUTE_UNUSED,
int size ATTRIBUTE_UNUSED)
{
/* Let the scheduler form additional regions. */
set_param_value ("max-sched-extend-regions-iters", 2);
2006-11-12 20:17:02 +01:00
/* Set the default values for cache-related parameters. */
set_param_value ("simultaneous-prefetches", 6);
set_param_value ("l1-cache-line-size", 32);
target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. 2008-10-14 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * target.h (struct gcc_target): Update prototypes of needs_block_p and gen_spec_check. * haifa-sched.c (create_check_block_twin): Update calls to the above. * sel-sched.c (create_speculation_check): Likewise. * doc/tm.texi: Provide documentation for new target hooks. * config/ia64/ia64.c: Include sel-sched.h. Rewrite speculation hooks. (ia64_gen_spec_insn): Removed. (get_spec_check_gen_function, insn_can_be_in_speculative_p, ia64_gen_spec_check): New static functions. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_skip_rtx_p): Declare functions. (ia64_needs_block_p): Change prototype. (ia64_gen_check): Rename to ia64_gen_spec_check. (ia64_adjust_cost): Rename to ia64_adjust_cost_2. Add new parameter into declaration, add special memory dependencies handling. (TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_SKIP_RTX_P): Define new target hooks. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. (ia64_optimization_options): Turn on selective scheduling with -O3, disable -fauto-inc-dec. Set mflag_sched_control_spec to true by default with selective scheduling. (ia64_override_options): Initialize align_loops and align_functions to 32 and 64, respectively. Set global selective scheduling flags according to target-dependent flags. (rtx_needs_barrier): Support UNSPEC_LDS_A. (group_barrier_needed): Use new mstop-bit-before-check flag. Add heuristic. (dfa_state_size): Make global. (spec_check_no, max_uid): Remove. (mem_ops_in_group, current_cycle): New variables. (ia64_sched_init): Disable checks for !SCHED_GROUP_P after reload. Initialize new variables. (is_load_p, record_memory_reference): New functions. (ia64_dfa_sched_reorder): Lower priority of loads when limit is reached. (ia64_variable_issue): Change use of current_sched_info to sched_deps_info. Update comment. Note if a load or a store is issued. (ia64_first_cycle_multipass_dfa_lookahead_guard_spec): Require a cycle advance if maximal number of loads or stores was issued on current cycle. (scheduled_good_insn): New static helper function. (ia64_dfa_new_cycle): Assert that last_scheduled_insn is set when a group barrier is needed. Fix vertical spacing. Guard the code doing state transition with last_scheduled_insn check. Mark that a stop bit should be before current insn if there was a cycle advance. Update current_cycle and mem_ops_in_group. (ia64_h_i_d_extended): Change use of current_sched_info to sched_deps_info. Reallocate stops_p by larger chunks. (struct _ia64_sched_context): New structure. (ia64_sched_context_t): New typedef. (ia64_alloc_sched_context, ia64_init_sched_context, ia64_set_sched_context, ia64_clear_sched_context, ia64_free_sched_context): New static functions. (gen_func_t): New typedef. (get_spec_load_gen_function): New function. (SPEC_GEN_EXTEND_OFFSET): Declare. (ia64_set_sched_flags): Check common_sched_info instead of *flags. (get_mode_no_for_insn): Change the condition that prevents use of special hardware registers so it can now handle pseudos. (get_spec_unspec_code): New function. (ia64_skip_rtx_p, get_insn_spec_code, ia64_get_insn_spec_ds, ia64_get_insn_checked_ds, ia64_gen_spec_load): New static functions. (ia64_speculate_insn, ia64_needs_block_p): Support branchy checks during selective scheduling. (ia64_speculate_insn): Use ds_get_speculation_types when determining whether we need to change the pattern. (SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): Declare. (ia64_spec_check_src_p): Support new speculation/check codes. (struct bundle_state): New field. (issue_nops_and_insn): Initialize it. (insert_bundle_state): Minimize mid-bundle stop bits. (important_for_bundling_p): New function. (get_next_important_insn): Use important_for_bundling_p. (bundling): When shifting TImode from unimportant insns, ignore also group barriers. Assert that best state is found before the backward bundling pass. Print number of mid-bundle stop bits. Minimize mid-bundle stop bits. Check correct calculation of mid-bundle stop bits. (ia64_sched_finish, final_emit_insn_group_barriers): Fix formatting. (final_emit_insn_group_barriers): Emit stop bits before insns starting a new cycle. (sel2_run): New variable. (ia64_reorg): When flag_selective_scheduling2 is set, run the selective scheduling pass instead of schedule_ebbs. * config/ia64/ia64.md (speculable1, speculable2): New attributes. (UNSPEC_LDS_A): New UNSPEC. (movqi_internal, movhi_internal, movsi_internal, movdi_internal, movti_internal, movsf_internal, movdf_internal, movxf_internal): Make visible. Add speculable* attributes. (output_c_nc): New mode attribute. (mov<mode>_speculative_a, zero_extend<mode>di2_speculative_a, mov<mode>_nc, zero_extend<mode>di2_nc, advanced_load_check_nc_<mode>): New insns. (zero_extend*): Add speculable* attributes. * config/ia64/ia64.opt (msched_fp_mem_deps_zero_cost): New option. (msched-stop-bits-after-every-cycle): Likewise. (msched-max-memory-insns, msched-max-memory-insns-hard-limit): Likewise. (msched-spec-verbose): Remove. (msched-prefer-non-data-spec-insns, msched-prefer-non-control-spec-insns, msched-count-spec-in-critical-path, msel-sched-dont-check-control-spec): Use Target Report Var instead of Common Report Var. * config/ia64/itanium2.md: Remove incorrect bypass. * config/ia64/t-ia64 (ia64.o): Add dependency on sel-sched.h. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r141108
2008-10-14 14:52:19 +02:00
set_param_value("sched-mem-true-dep-cost", 4);
}
/* HP-UX version_id attribute.
For object foo, if the version_id is set to 1234 put out an alias
of '.alias foo "foo{1234}" We can't use "foo{1234}" in anything
other than an alias statement because it is an illegal symbol name. */
static tree
ia64_handle_version_id_attribute (tree *node ATTRIBUTE_UNUSED,
tree name ATTRIBUTE_UNUSED,
tree args,
int flags ATTRIBUTE_UNUSED,
bool *no_add_attrs)
{
tree arg = TREE_VALUE (args);
if (TREE_CODE (arg) != STRING_CST)
{
error("version attribute is not a string");
*no_add_attrs = true;
return NULL_TREE;
}
return NULL_TREE;
}
/* Target hook for c_mode_for_suffix. */
static enum machine_mode
ia64_c_mode_for_suffix (char suffix)
{
if (suffix == 'q')
return TFmode;
if (suffix == 'w')
return XFmode;
return VOIDmode;
}
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
static enum machine_mode
ia64_promote_function_mode (const_tree type,
enum machine_mode mode,
int *punsignedp,
const_tree funtype,
int for_return)
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
{
/* Special processing required for OpenVMS ... */
if (!TARGET_ABI_OPEN_VMS)
return default_promote_function_mode(type, mode, punsignedp, funtype,
for_return);
ia64.c: Include libfuncs.h. * config/ia64/ia64.c: Include libfuncs.h. (TARGET_PROMOTE_FUNCITON_MODE): Define target macro. (ia64_expand_call): Use reg 25 on VMS. (ia64_initialize_trampoline): Fix for VMS ABI. (ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS. (ia64_function_arg): Initialize reg 25 on VMS. Fix OpenVMS ABI issues for varargs. For OpenVMS, emit the Argument Information register set in the incoming/sibcall case as well. (ia64_arg_type): New function. (ia64_function_arg_advance): Keep track of cum->words. Fix OpenVMS ABI issues for varargs. (ia64_function_value): On VMS, promote mode of non-aggregate types. (ia64_override_options): Set flag_no_common on VMS. (ia64_init_builtins): Disable FWRITE builtin. (ia64_asm_output_external): Call DO_CRTL_NAMES. (ia64_vms_init_libfuncs): Add decc$ routines. (ia64_vms_valid_pointer_mode): New function. (ia64_struct_value_rtx): Allways NULL_RTX on VMS. (ia64_promote_function_mode): New function * config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default. (LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS. (LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise. (INIT_CUMULATIVE_ARGS): Add atypes for VMS. (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. (ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit. Suppress trailing '#' if VALUE is numeric. * config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to ia64_promote_function_mode. (TARGET_VALID_POINTER_MODE): Define. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r151009
2009-08-22 04:50:30 +02:00
/* HP OpenVMS Calling Standard dated June, 2004, that describes
HP OpenVMS I64 Version 8.2EFT,
chapter 4 "OpenVMS I64 Conventions"
section 4.7 "Procedure Linkage"
subsection 4.7.5.2, "Normal Register Parameters"
"Unsigned integral (except unsigned 32-bit), set, and VAX floating-point
values passed in registers are zero-filled; signed integral values as
well as unsigned 32-bit integral values are sign-extended to 64 bits.
For all other types passed in the general registers, unused bits are
undefined." */
if (!AGGREGATE_TYPE_P (type)
&& GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD)
{
if (mode == SImode)
*punsignedp = 0;
return DImode;
}
else
return promote_mode (type, mode, punsignedp);
}
static GTY(()) rtx ia64_dconst_0_5_rtx;
rtx
ia64_dconst_0_5 (void)
{
if (! ia64_dconst_0_5_rtx)
{
REAL_VALUE_TYPE rv;
real_from_string (&rv, "0.5");
ia64_dconst_0_5_rtx = const_double_from_real_value (rv, DFmode);
}
return ia64_dconst_0_5_rtx;
}
static GTY(()) rtx ia64_dconst_0_375_rtx;
rtx
ia64_dconst_0_375 (void)
{
if (! ia64_dconst_0_375_rtx)
{
REAL_VALUE_TYPE rv;
real_from_string (&rv, "0.375");
ia64_dconst_0_375_rtx = const_double_from_real_value (rv, DFmode);
}
return ia64_dconst_0_375_rtx;
}
#include "gt-ia64.h"